diff options
| author | Hans Petter Selasky <hselasky@FreeBSD.org> | 2014-06-27 15:23:12 +0000 |
|---|---|---|
| committer | Hans Petter Selasky <hselasky@FreeBSD.org> | 2014-06-27 15:23:12 +0000 |
| commit | 04006eabea235d9db8c0f7e40af9e441b25638f8 (patch) | |
| tree | 04814412c3d111c44571c8be1ed57938d3551586 /sbin/sysctl/sysctl.c | |
| parent | cde1f5b8a0978862e6b2bcca495a0ef4e6830f58 (diff) | |
Notes
Diffstat (limited to 'sbin/sysctl/sysctl.c')
| -rw-r--r-- | sbin/sysctl/sysctl.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index a86d659cb040..13596450d2e1 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -710,9 +710,10 @@ show_var(int *oid, int nlen) warnx("malloc failed"); return (1); } + ctltype = (kind & CTLTYPE); len = j; i = sysctl(oid, nlen, val, &len, 0, 0); - if (i || !len) { + if (i != 0 || (len == 0 && ctltype != CTLTYPE_STRING)) { free(oval); return (1); } @@ -724,7 +725,6 @@ show_var(int *oid, int nlen) } val[len] = '\0'; p = val; - ctltype = (kind & CTLTYPE); sign = ctl_sign[ctltype]; intlen = ctl_size[ctltype]; |
