summaryrefslogtreecommitdiff
path: root/usr.sbin/tcpdump/addrtoname.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2000-10-31 16:06:50 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2000-10-31 16:06:50 +0000
commit6458c7204b16a44af80ae092c3774fcaaba43b63 (patch)
tree55e9f6d4ddb2ce91cd263a9a038ea87987e41d05 /usr.sbin/tcpdump/addrtoname.c
parent0240837695c0242b03f6debd86a0fe268ab6666a (diff)
some buffer care; jakob
Diffstat (limited to 'usr.sbin/tcpdump/addrtoname.c')
-rw-r--r--usr.sbin/tcpdump/addrtoname.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/tcpdump/addrtoname.c b/usr.sbin/tcpdump/addrtoname.c
index ad02cdfa129..6b693013400 100644
--- a/usr.sbin/tcpdump/addrtoname.c
+++ b/usr.sbin/tcpdump/addrtoname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: addrtoname.c,v 1.15 2000/10/03 14:31:54 ho Exp $ */
+/* $OpenBSD: addrtoname.c,v 1.16 2000/10/31 16:06:46 deraadt Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997
@@ -25,7 +25,7 @@
*/
#ifndef lint
static const char rcsid[] =
- "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/addrtoname.c,v 1.15 2000/10/03 14:31:54 ho Exp $ (LBL)";
+ "@(#) $Header: /cvs/OpenBSD/src/usr.sbin/tcpdump/addrtoname.c,v 1.16 2000/10/31 16:06:46 deraadt Exp $ (LBL)";
#endif
#include <sys/types.h>
@@ -654,7 +654,7 @@ tcpport_string(u_short port)
tp->addr = i;
tp->nxt = newhnamemem();
- (void)sprintf(buf, "%u", i);
+ (void)snprintf(buf, sizeof(buf), "%u", i);
tp->name = savestr(buf);
return (tp->name);
}
@@ -699,7 +699,7 @@ init_servarray(void)
while (table->name)
table = table->nxt;
if (nflag) {
- (void)sprintf(buf, "%d", port);
+ (void)snprintf(buf, sizeof(buf), "%d", port);
table->name = savestr(buf);
} else
table->name = savestr(sv->s_name);