aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatthew Dillon <dillon@FreeBSD.org>2002-04-06 05:21:57 +0000
committerMatthew Dillon <dillon@FreeBSD.org>2002-04-06 05:21:57 +0000
commit87bd4d6cebf7920a85576ef11c962862fdf22966 (patch)
treecf589f7496f3c42fb6690780a2633cc6f66e7834 /lib
parent65528d17826ca7dd6b516112ee5dbda7829ad8ab (diff)
downloadsrc-87bd4d6cebf7920a85576ef11c962862fdf22966.tar.gz
src-87bd4d6cebf7920a85576ef11c962862fdf22966.zip
Fix ether_ntoa() to generate the %02x format people expect, instead of %x,
for the ethernet address. MFC after: 1 day
Notes
Notes: svn path=/head/; revision=93929
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/net/ether_addr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libc/net/ether_addr.c b/lib/libc/net/ether_addr.c
index 40f0ec8200dd..1651f4c2a3ee 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);