diff options
author | deraadt <> | 2003-09-26 06:19:25 +0000 |
---|---|---|
committer | deraadt <> | 2003-09-26 06:19:25 +0000 |
commit | 25b92f5cce5fd2ad349851e534e34ebf51ee7b03 (patch) | |
tree | 23a403c334770781fc1720a4fa16f49a62bfc847 | |
parent | 23b7258456796cbac18e1e9308be05344f752a33 (diff) | |
download | openbsd-25b92f5cce5fd2ad349851e534e34ebf51ee7b03.tar.gz openbsd-25b92f5cce5fd2ad349851e534e34ebf51ee7b03.tar.bz2 openbsd-25b92f5cce5fd2ad349851e534e34ebf51ee7b03.zip |
fix buffer size; leonard+gnats@itee.uq.edu.au
-rw-r--r-- | src/lib/libc/net/ipx_ntoa.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/lib/libc/net/ipx_ntoa.c b/src/lib/libc/net/ipx_ntoa.c index 5f847624fb..64ba146b31 100644 --- a/src/lib/libc/net/ipx_ntoa.c +++ b/src/lib/libc/net/ipx_ntoa.c | |||
@@ -28,7 +28,7 @@ | |||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #if defined(LIBC_SCCS) && !defined(lint) | 30 | #if defined(LIBC_SCCS) && !defined(lint) |
31 | static char rcsid[] = "$OpenBSD: ipx_ntoa.c,v 1.4 2003/06/02 20:18:35 millert Exp $"; | 31 | static char rcsid[] = "$OpenBSD: ipx_ntoa.c,v 1.5 2003/09/26 06:19:25 deraadt Exp $"; |
32 | #endif /* LIBC_SCCS and not lint */ | 32 | #endif /* LIBC_SCCS and not lint */ |
33 | 33 | ||
34 | #include <sys/param.h> | 34 | #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 | |||
36 | #include <stdio.h> | 36 | #include <stdio.h> |
37 | 37 | ||
38 | char * | 38 | char * |
39 | ipx_ntoa(addr) | 39 | ipx_ntoa(struct ipx_addr addr) |
40 | struct ipx_addr addr; | ||
41 | { | 40 | { |
42 | static char obuf[] = "xxxx.xx:xx:xx:xx:xx:xx.uuuuu"; | 41 | static char obuf[] = "xxxxxxxxH.xx:xx:xx:xx:xx:xx.uuuuu"; |
43 | 42 | ||
44 | snprintf(obuf, sizeof obuf, "%8xH.%02x:%02x:%02x:%02x:%02x:%02x.%u", | 43 | snprintf(obuf, sizeof obuf, "%8xH.%02x:%02x:%02x:%02x:%02x:%02x.%u", |
45 | ntohl(addr.ipx_net.l_net), | 44 | ntohl(addr.ipx_net.l_net), addr.ipx_host.c_host[0], |
46 | addr.ipx_host.c_host[0], | 45 | addr.ipx_host.c_host[1], addr.ipx_host.c_host[2], |
47 | addr.ipx_host.c_host[1], | 46 | addr.ipx_host.c_host[3], addr.ipx_host.c_host[4], |
48 | addr.ipx_host.c_host[2], | 47 | addr.ipx_host.c_host[5], ntohs(addr.ipx_port)); |
49 | addr.ipx_host.c_host[3], | ||
50 | addr.ipx_host.c_host[4], | ||
51 | addr.ipx_host.c_host[5], | ||
52 | ntohs(addr.ipx_port)); | ||
53 | return (obuf); | 48 | return (obuf); |
54 | } | 49 | } |