From 930f8eb170d60eb03d65557875371344cefe4d1f Mon Sep 17 00:00:00 2001 From: dillon Date: Sat, 6 Apr 2002 05:21:57 +0000 Subject: Fix ether_ntoa() to generate the %02x format people expect, instead of %x, for the ethernet address. MFC after: 1 day --- lib/libc/net/ether_addr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/net/ether_addr.c b/lib/libc/net/ether_addr.c index 40f0ec8..1651f4c 100644 --- a/lib/libc/net/ether_addr.c +++ b/lib/libc/net/ether_addr.c @@ -118,8 +118,9 @@ char int i; static char a[18]; - i = sprintf(a,"%x:%x:%x:%x:%x:%x",n->octet[0],n->octet[1],n->octet[2], - n->octet[3],n->octet[4],n->octet[5]); + i = sprintf(a,"%02x:%02x:%02x:%02x:%02x:%02x", + n->octet[0],n->octet[1],n->octet[2], + n->octet[3],n->octet[4],n->octet[5]); if (i < 11) return (NULL); return ((char *)&a); -- cgit v1.1