summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 5d72606..19d10ac 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);
+ }
}
/*
OpenPOWER on IntegriCloud