diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-09-26 06:19:26 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-09-26 06:19:26 +0000 |
commit | 5c25aaf523fe23d9222bc659291cbcea6062c9b7 (patch) | |
tree | 6a24d18f4ba438802f26a9f32c17c4393061456c /lib/libc | |
parent | 50555087ef122c6df5c6380f5baf4cdf597c5b99 (diff) |
fix buffer size; leonard+gnats@itee.uq.edu.au
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/net/ipx_ntoa.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/lib/libc/net/ipx_ntoa.c b/lib/libc/net/ipx_ntoa.c index 5f847624fb3..64ba146b315 100644 --- a/lib/libc/net/ipx_ntoa.c +++ b/lib/libc/net/ipx_ntoa.c @@ -28,7 +28,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: ipx_ntoa.c,v 1.4 2003/06/02 20:18:35 millert Exp $"; +static char rcsid[] = "$OpenBSD: ipx_ntoa.c,v 1.5 2003/09/26 06:19:25 deraadt Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -36,19 +36,14 @@ static char rcsid[] = "$OpenBSD: ipx_ntoa.c,v 1.4 2003/06/02 20:18:35 millert Ex #include <stdio.h> char * -ipx_ntoa(addr) - struct ipx_addr addr; +ipx_ntoa(struct ipx_addr addr) { - static char obuf[] = "xxxx.xx:xx:xx:xx:xx:xx.uuuuu"; + static char obuf[] = "xxxxxxxxH.xx:xx:xx:xx:xx:xx.uuuuu"; snprintf(obuf, sizeof obuf, "%8xH.%02x:%02x:%02x:%02x:%02x:%02x.%u", - ntohl(addr.ipx_net.l_net), - addr.ipx_host.c_host[0], - addr.ipx_host.c_host[1], - addr.ipx_host.c_host[2], - addr.ipx_host.c_host[3], - addr.ipx_host.c_host[4], - addr.ipx_host.c_host[5], - ntohs(addr.ipx_port)); + ntohl(addr.ipx_net.l_net), addr.ipx_host.c_host[0], + addr.ipx_host.c_host[1], addr.ipx_host.c_host[2], + addr.ipx_host.c_host[3], addr.ipx_host.c_host[4], + addr.ipx_host.c_host[5], ntohs(addr.ipx_port)); return (obuf); } |