diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-11-06 03:11:41 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2001-11-06 03:11:41 +0000 |
commit | ae6af869059184f071b9cf98a62cdfbeb9459b25 (patch) | |
tree | 08478b1b2ac68b8a23edcda7dca0343cb6b40366 /usr.sbin/tcpdump/print-cnfp.c | |
parent | 95ad5e3fd5480be62b7baba07cf74ec1fb46ba7e (diff) |
a bit of snprintf cleaning
Diffstat (limited to 'usr.sbin/tcpdump/print-cnfp.c')
-rw-r--r-- | usr.sbin/tcpdump/print-cnfp.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/usr.sbin/tcpdump/print-cnfp.c b/usr.sbin/tcpdump/print-cnfp.c index 9bf2b59c87c..e2de4866f95 100644 --- a/usr.sbin/tcpdump/print-cnfp.c +++ b/usr.sbin/tcpdump/print-cnfp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-cnfp.c,v 1.3 2000/10/03 14:21:56 ho Exp $ */ +/* $OpenBSD: print-cnfp.c,v 1.4 2001/11/06 03:11:40 deraadt Exp $ */ /* * Copyright (c) 1998 Michael Shalayeff @@ -117,15 +117,19 @@ cnfp_print(register const u_char *cp, u_int len, register const u_char *bp) asbuf[0] = buf[0] = '\0'; if (ver == 5) { - sprintf(buf, "/%d", (ntohl(nr->masks) >> 24) & 0xff); - sprintf(asbuf, "%d:", (ntohl(nr->asses) >> 16) & 0xffff); + snprintf(buf, sizeof buf, "/%d", + (ntohl(nr->masks) >> 24) & 0xff); + snprintf(asbuf, sizeof asbuf, "%d:", + (ntohl(nr->asses) >> 16) & 0xffff); } printf("\n %s%s%s:%u ", inet_ntoa(nr->src_ina), buf, asbuf, ntohl(nr->ports) >> 16); if (ver == 5) { - sprintf(buf, "/%d", (ntohl(nr->masks) >> 16) & 0xff); - sprintf(asbuf, "%d:", ntohl(nr->asses) & 0xffff); + snprintf(buf, sizeof buf, "/%d", + (ntohl(nr->masks) >> 16) & 0xff); + snprintf(asbuf, sizeof asbuf, "%d:", + ntohl(nr->asses) & 0xffff); } printf("> %s%s%s:%u ", inet_ntoa(nr->dst_ina), buf, asbuf, ntohl(nr->ports) & 0xffff); |