Module Name: src
Committed By: christos
Date: Wed Dec 5 13:53:39 UTC 2012
Modified Files:
src/sbin/sysctl: sysctl.c
Log Message:
fix bug found by clang.
To generate a diff of this commit:
cvs rdiff -u -r1.146 -r1.147 src/sbin/sysctl/sysctl.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sbin/sysctl/sysctl.c
diff -u src/sbin/sysctl/sysctl.c:1.146 src/sbin/sysctl/sysctl.c:1.147
--- src/sbin/sysctl/sysctl.c:1.146 Sat Dec 1 10:30:16 2012
+++ src/sbin/sysctl/sysctl.c Wed Dec 5 08:53:39 2012
@@ -1,4 +1,4 @@
-/* $NetBSD: sysctl.c,v 1.146 2012/12/01 15:30:16 christos Exp $ */
+/* $NetBSD: sysctl.c,v 1.147 2012/12/05 13:53:39 christos Exp $ */
/*-
* Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@ __COPYRIGHT("@(#) Copyright (c) 1993\
#if 0
static char sccsid[] = "@(#)sysctl.c 8.1 (Berkeley) 6/6/93";
#else
-__RCSID("$NetBSD: sysctl.c,v 1.146 2012/12/01 15:30:16 christos Exp $");
+__RCSID("$NetBSD: sysctl.c,v 1.147 2012/12/05 13:53:39 christos Exp $");
#endif
#endif /* not lint */
@@ -2722,7 +2722,7 @@ bitmask_scan(const void *v, uint32_t *o)
char *s = strdup(v);
if (s == NULL)
err(1, "");
- __BITMAP_ZERO(o);
+
for (s = strtok(s, ","); s; s = strtok(NULL, ",")) {
char *e;
errno = 0;
@@ -2749,6 +2749,7 @@ reserve(HANDLER_ARGS)
osz = sizeof(o);
if (value) {
+ __BITMAP_ZERO(n);
bitmask_scan(value, n);
value = (char *)n;
nsz = sizeof(n);