From 4d155cbf37ca909daff06dd8c7119274d0861f6c Mon Sep 17 00:00:00 2001 From: Bob Gilligan Date: Sun, 16 Jan 2011 22:44:12 -0800 Subject: Merge upstream version 0.3.4. (cherry picked from commit 21eb1c8d6fefa5dcd3a9a800b4add06d5c30c01f) --- src/read_proc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/read_proc.c') 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); -- cgit v1.2.3