summaryrefslogtreecommitdiff
path: root/src/read_proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/read_proc.c')
-rw-r--r--src/read_proc.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/read_proc.c b/src/read_proc.c
index aea203f..c89cb6d 100644
--- a/src/read_proc.c
+++ b/src/read_proc.c
@@ -25,7 +25,7 @@ static struct network_device *add_interface(struct libbiosdevname_state *state,
return NULL;
memset(i, 0, sizeof(*i));
INIT_LIST_HEAD(&i->node);
- snprintf(i->kernel_name, sizeof(i->kernel_name), name);
+ strncpy(i->kernel_name, name, sizeof(i->kernel_name));
list_add_tail(&i->node, &state->network_devices);
return i;
}
@@ -96,10 +96,8 @@ int get_interfaces(struct libbiosdevname_state *state)
s = get_name(&name, line);
add_interface(state, name);
}
- if (ferror(fh)) {
- perror(_PATH_PROCNET_DEV);
+ if (ferror(fh))
err = -1;
- }
out:
free(line);