summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulio Merino <jmmv@FreeBSD.org>2014-03-12 12:27:13 +0000
committerJulio Merino <jmmv@FreeBSD.org>2014-03-12 12:27:13 +0000
commit76a1f42f3f07578e7ec3fe0cd099a60769ae4ab7 (patch)
tree699b3dc21b3065fd2a18a9275b6018f84cad92cf
parentb209f5fa3824247c8cc1b5aab579b756d0e29673 (diff)
Notes
-rw-r--r--lib/libc/net/ether_addr.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libc/net/ether_addr.c b/lib/libc/net/ether_addr.c
index 5d72606af050..19d10ac5e857 100644
--- a/lib/libc/net/ether_addr.c
+++ b/lib/libc/net/ether_addr.c
@@ -72,11 +72,13 @@ ether_line(const char *l, struct ether_addr *e, char *hostname)
i = sscanf(l, "%x:%x:%x:%x:%x:%x %s", &o[0], &o[1], &o[2], &o[3],
&o[4], &o[5], hostname);
- if (i != 7)
- return (i);
- for (i=0; i<6; i++)
- e->octet[i] = o[i];
- return (0);
+ if (i == 7) {
+ for (i = 0; i < 6; i++)
+ e->octet[i] = o[i];
+ return (0);
+ } else {
+ return (-1);
+ }
}
/*