summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2003-09-26 06:19:25 +0000
committerderaadt <deraadt@openbsd.org>2003-09-26 06:19:25 +0000
commit566154b6966bacef2ae64c710b5891d384b772b5 (patch)
tree6d019eca9424c8de2f7b945530f51b19af85f55e
parentfix columns; sahara@surt.net (diff)
downloadwireguard-openbsd-566154b6966bacef2ae64c710b5891d384b772b5.tar.xz
wireguard-openbsd-566154b6966bacef2ae64c710b5891d384b772b5.zip
fix buffer size; leonard+gnats@itee.uq.edu.au
-rw-r--r--lib/libc/net/ipx_ntoa.c19
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);
}