summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2001-01-22 23:10:34 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2001-01-22 23:10:34 +0000
commitbcca963f832dbbedbfe5683242090ee584d64ddf (patch)
tree9479904288158e3921c2fb40e223d643b300a4ba /sbin
parent4dd9cfa6a657c76f3c5440192f965e6c34bdee07 (diff)
attempting to sysctl clear a string was failing; checked by millert and aaron
Diffstat (limited to 'sbin')
-rw-r--r--sbin/sysctl/sysctl.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index f77eef1dc98..61fcc420c24 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.58 2001/01/04 22:02:02 angelos Exp $ */
+/* $OpenBSD: sysctl.c,v 1.59 2001/01/22 23:10:33 deraadt Exp $ */
/* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)sysctl.c 8.5 (Berkeley) 5/9/95";
#else
-static char *rcsid = "$OpenBSD: sysctl.c,v 1.58 2001/01/04 22:02:02 angelos Exp $";
+static char *rcsid = "$OpenBSD: sysctl.c,v 1.59 2001/01/22 23:10:33 deraadt Exp $";
#endif
#endif /* not lint */
@@ -568,7 +568,7 @@ parse(string, flags)
}
}
size = BUFSIZ;
- if (sysctl(mib, len, buf, &size, newsize ? newval : 0, newsize) == -1) {
+ if (sysctl(mib, len, buf, &size, newval, newsize) == -1) {
if (flags == 0)
return;
switch (errno) {
@@ -744,7 +744,7 @@ parse(string, flags)
return;
case CTLTYPE_STRING:
- if (newsize == 0) {
+ if (newval == NULL) {
if (!nflag)
(void)printf("%s = ", string);
(void)puts(buf);