aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/net/ether_addr.c
diff options
context:
space:
mode:
authorJordan K. Hubbard <jkh@FreeBSD.org>1996-07-12 18:57:58 +0000
committerJordan K. Hubbard <jkh@FreeBSD.org>1996-07-12 18:57:58 +0000
commit51295a4d3e4c551df85249433c490208dc7fd23d (patch)
treec116431af8e1f042b25e0f70c63c437cf7ff8d63 /lib/libc/net/ether_addr.c
parentaf7a29993083b1562f01c87bb774fbe4fc3579e7 (diff)
General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>
Notes
Notes: svn path=/head/; revision=17141
Diffstat (limited to 'lib/libc/net/ether_addr.c')
-rw-r--r--lib/libc/net/ether_addr.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/lib/libc/net/ether_addr.c b/lib/libc/net/ether_addr.c
index 934a76bcbc34..2d2101dfe5cd 100644
--- a/lib/libc/net/ether_addr.c
+++ b/lib/libc/net/ether_addr.c
@@ -35,7 +35,7 @@
* Center for Telecommunications Research
* Columbia University, New York City
*
- * $Id: ether_addr.c,v 1.2 1995/08/07 03:42:14 wpaul Exp $
+ * $Id: ether_addr.c,v 1.3 1996/03/16 21:25:59 wpaul Exp $
*/
@@ -90,11 +90,20 @@ struct ether_addr *ether_aton(a)
{
int i;
static struct ether_addr o;
+ unsigned int o0, o1, o2, o3, o4, o5;
+
+ i = sscanf(a, "%x:%x:%x:%x:%x:%x", &o0, &o1, &o2, &o3, &o4, &o5);
- i = sscanf(a, "%x:%x:%x:%x:%x:%x", o.octet[0], o.octet[1], o.octet[2],
- o.octet[3], o.octet[4], o.octet[5]);
if (i != 6)
return (NULL);
+
+ o.octet[0]=o0;
+ o.octet[1]=o1;
+ o.octet[2]=o2;
+ o.octet[3]=o3;
+ o.octet[4]=o4;
+ o.octet[5]=o5;
+
return ((struct ether_addr *)&o);
}