summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hill <dhill@cvs.openbsd.org>2006-03-20 20:01:35 +0000
committerDavid Hill <dhill@cvs.openbsd.org>2006-03-20 20:01:35 +0000
commitf2bcf8b2e2f2264bc32cdafdb7bff570972631dd (patch)
tree90d411e3cbe3931feec03cf88f3c9a292154d816
parent43176755fa5c6de09296b9117308040713428bd3 (diff)
NetBSD Coverity CID 774: Don't increment a pointer *before* testing it for NULL!
ok otto@
-rw-r--r--sbin/brconfig/brconfig.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sbin/brconfig/brconfig.c b/sbin/brconfig/brconfig.c
index 6f0abb19a89..10c1d3e64f7 100644
--- a/sbin/brconfig/brconfig.c
+++ b/sbin/brconfig/brconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: brconfig.c,v 1.34 2005/12/21 01:40:23 millert Exp $ */
+/* $OpenBSD: brconfig.c,v 1.35 2006/03/20 20:01:34 dhill Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -1353,8 +1353,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))) {