summaryrefslogtreecommitdiffstats
path: root/usr.sbin/tcpdump/util.c
diff options
context:
space:
mode:
authormpf <mpf@openbsd.org>2008-09-19 08:52:16 +0000
committermpf <mpf@openbsd.org>2008-09-19 08:52:16 +0000
commit72ff0ec3ada1a73d56ca2e5c41f6929563b04475 (patch)
tree171ede237c83bf9d52c8a848c19e78b93323388e /usr.sbin/tcpdump/util.c
parenttypo (diff)
downloadwireguard-openbsd-72ff0ec3ada1a73d56ca2e5c41f6929563b04475.tar.xz
wireguard-openbsd-72ff0ec3ada1a73d56ca2e5c41f6929563b04475.zip
Merge printb() fix from ifconfig.c -r 1.157:
Don't increment a pointer *before* testing it for NULL. OK canacar@
Diffstat (limited to 'usr.sbin/tcpdump/util.c')
-rw-r--r--usr.sbin/tcpdump/util.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/tcpdump/util.c b/usr.sbin/tcpdump/util.c
index f8d9f8cf97f..d103c04193e 100644
--- a/usr.sbin/tcpdump/util.c
+++ b/usr.sbin/tcpdump/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.23 2007/10/07 16:41:05 deraadt Exp $ */
+/* $OpenBSD: util.c,v 1.24 2008/09/19 08:52:16 mpf Exp $ */
/*
* Copyright (c) 1990, 1991, 1993, 1994, 1995, 1996, 1997
@@ -23,7 +23,7 @@
#ifndef lint
static const char rcsid[] =
- "@(#) $Id: util.c,v 1.23 2007/10/07 16:41:05 deraadt Exp $ (LBL)";
+ "@(#) $Id: util.c,v 1.24 2008/09/19 08:52:16 mpf Exp $ (LBL)";
#endif
#include <sys/types.h>
@@ -337,8 +337,9 @@ printb(char *s, unsigned short v, char *bits)
printf("%s=%o", s, v);
else
printf("%s=%x", s, v);
- bits++;
+
if (bits) {
+ bits++;
putchar('<');
while ((i = *bits++)) {
if (v & (1 << (i-1))) {