diff options
author | 2001-11-06 03:11:40 +0000 | |
---|---|---|
committer | 2001-11-06 03:11:40 +0000 | |
commit | 2ac8abef688ef02d05835334aaa56d90c9b79faa (patch) | |
tree | e6fe75a02a2e95a1b5ae8cec1f800dfc114b6059 /usr.sbin/tcpdump/print-decnet.c | |
parent | remove per art@ (diff) | |
download | wireguard-openbsd-2ac8abef688ef02d05835334aaa56d90c9b79faa.tar.xz wireguard-openbsd-2ac8abef688ef02d05835334aaa56d90c9b79faa.zip |
a bit of snprintf cleaning
Diffstat (limited to 'usr.sbin/tcpdump/print-decnet.c')
-rw-r--r-- | usr.sbin/tcpdump/print-decnet.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/tcpdump/print-decnet.c b/usr.sbin/tcpdump/print-decnet.c index ad817cd6e7c..84167401e1c 100644 --- a/usr.sbin/tcpdump/print-decnet.c +++ b/usr.sbin/tcpdump/print-decnet.c @@ -1,4 +1,4 @@ -/* $OpenBSD: print-decnet.c,v 1.8 2000/10/03 14:31:56 ho Exp $ */ +/* $OpenBSD: print-decnet.c,v 1.9 2001/11/06 03:11:40 deraadt Exp $ */ /* * Copyright (c) 1992, 1993, 1994, 1995, 1996, 1997 @@ -23,7 +23,7 @@ #ifndef lint static const char rcsid[] = - "@(#) $Header: /home/cvs/src/usr.sbin/tcpdump/print-decnet.c,v 1.8 2000/10/03 14:31:56 ho Exp $ (LBL)"; + "@(#) $Header: /home/cvs/src/usr.sbin/tcpdump/print-decnet.c,v 1.9 2001/11/06 03:11:40 deraadt Exp $ (LBL)"; #endif #include <sys/param.h> @@ -737,11 +737,12 @@ dnnum_string(u_short dnaddr) char *str; int area = (u_short)(dnaddr & AREAMASK) >> AREASHIFT; int node = dnaddr & NODEMASK; + int len = sizeof("00.0000"); - str = (char *)malloc(sizeof("00.0000")); + str = (char *)malloc(len); if (str == NULL) error("dnnum_string: malloc"); - sprintf(str, "%d.%d", area, node); + snprintf(str, len, "%d.%d", area, node); return(str); } |