summaryrefslogtreecommitdiff
path: root/src/read_proc.c
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2011-01-16 22:44:12 -0800
committerBob Gilligan <gilligan@vyatta.com>2011-01-16 23:07:47 -0800
commit4d155cbf37ca909daff06dd8c7119274d0861f6c (patch)
treefe9d460fb46097986fe234fddb3f9bd2935c8642 /src/read_proc.c
parent9405281a9e16e55af687c98a83d327946953cc09 (diff)
downloadvyatta-biosdevname-4d155cbf37ca909daff06dd8c7119274d0861f6c.tar.gz
vyatta-biosdevname-4d155cbf37ca909daff06dd8c7119274d0861f6c.zip
Merge upstream version 0.3.4.
(cherry picked from commit 21eb1c8d6fefa5dcd3a9a800b4add06d5c30c01f)
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);