diff options
author | David Hill <dhill@cvs.openbsd.org> | 2006-03-20 20:12:46 +0000 |
---|---|---|
committer | David Hill <dhill@cvs.openbsd.org> | 2006-03-20 20:12:46 +0000 |
commit | 0f5ef76916936b0c2154ed95cdab6cfd11c8f6a2 (patch) | |
tree | 9b1d0c0b9b72b28d4899763d1a86110371b30f9a /sbin/ifconfig | |
parent | fc46bdd7356d3a09a8af408835950cd361e21c1c (diff) |
Don't increment a pointer *before* testing it for NULL
ok deraadt@
Diffstat (limited to 'sbin/ifconfig')
-rw-r--r-- | sbin/ifconfig/ifconfig.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sbin/ifconfig/ifconfig.c b/sbin/ifconfig/ifconfig.c index 72089a68af7..9666cbfd248 100644 --- a/sbin/ifconfig/ifconfig.c +++ b/sbin/ifconfig/ifconfig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ifconfig.c,v 1.156 2006/01/05 15:00:10 norby Exp $ */ +/* $OpenBSD: ifconfig.c,v 1.157 2006/03/20 20:12:45 dhill Exp $ */ /* $NetBSD: ifconfig.c,v 1.40 1997/10/01 02:19:43 enami Exp $ */ /* @@ -3434,8 +3434,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))) { @@ -3461,8 +3462,8 @@ printb_status(unsigned short v, char *bits) int i, any = 0; char c; - bits++; if (bits) { + bits++; while ((i = *bits++)) { if (v & (1 << (i-1))) { if (any) |