summaryrefslogtreecommitdiff
path: root/src/lib/libc/net/ns_ntoa.c
diff options
context:
space:
mode:
authorderaadt <>2002-05-24 21:22:37 +0000
committerderaadt <>2002-05-24 21:22:37 +0000
commit2be7fb6fb1368b131cd6a8f7ee34d9c11ef25a64 (patch)
tree96f82217a2fd5234ac1e25601237e64983eef146 /src/lib/libc/net/ns_ntoa.c
parent4bb76773d7dd0051cb98a137db9aeefb61518f5a (diff)
downloadopenbsd-2be7fb6fb1368b131cd6a8f7ee34d9c11ef25a64.tar.gz
openbsd-2be7fb6fb1368b131cd6a8f7ee34d9c11ef25a64.tar.bz2
openbsd-2be7fb6fb1368b131cd6a8f7ee34d9c11ef25a64.zip
try to use strlcpy and snprintf more; ok various
Diffstat (limited to 'src/lib/libc/net/ns_ntoa.c')
-rw-r--r--src/lib/libc/net/ns_ntoa.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libc/net/ns_ntoa.c b/src/lib/libc/net/ns_ntoa.c
index 130ccd388b..3c82bc3cee 100644
--- a/src/lib/libc/net/ns_ntoa.c
+++ b/src/lib/libc/net/ns_ntoa.c
@@ -32,7 +32,7 @@
32 */ 32 */
33 33
34#if defined(LIBC_SCCS) && !defined(lint) 34#if defined(LIBC_SCCS) && !defined(lint)
35static char rcsid[] = "$OpenBSD: ns_ntoa.c,v 1.8 2002/02/16 21:27:23 millert Exp $"; 35static char rcsid[] = "$OpenBSD: ns_ntoa.c,v 1.9 2002/05/24 21:22:37 deraadt Exp $";
36#endif /* LIBC_SCCS and not lint */ 36#endif /* LIBC_SCCS and not lint */
37 37
38#include <sys/param.h> 38#include <sys/param.h>
@@ -54,7 +54,7 @@ ns_ntoa(addr)
54 u_char *uplim = up + 6; 54 u_char *uplim = up + 6;
55 55
56 net.net_e = addr.x_net; 56 net.net_e = addr.x_net;
57 sprintf(obuf, "%x", ntohl(net.long_e)); 57 snprintf(obuf, sizeof obuf, "%x", ntohl(net.long_e));
58 cp = spectHex(obuf); 58 cp = spectHex(obuf);
59 cp2 = cp + 1; 59 cp2 = cp + 1;
60 while (*up==0 && up < uplim) up++; 60 while (*up==0 && up < uplim) up++;