diff options
author | peter <peter@FreeBSD.org> | 2002-11-12 21:18:21 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 2002-11-12 21:18:21 +0000 |
commit | 06cee96130b552bf58d882bf86df29b9bc0ba33d (patch) | |
tree | 67ca8ab87e00d3ac68c02cc03dfb3be4e69407d7 /sbin/sysctl | |
parent | b7191db17bf13706a649e1f6a3fd4dfc5b324cdc (diff) | |
download | FreeBSD-src-06cee96130b552bf58d882bf86df29b9bc0ba33d.zip FreeBSD-src-06cee96130b552bf58d882bf86df29b9bc0ba33d.tar.gz |
Fix a "bug" in sysctl(8). Limit the length when we print a string from
the kernel rather than ignoring the length and keeping on going till we
finally hit a \0 character in the buffer.
Diffstat (limited to 'sbin/sysctl')
-rw-r--r-- | sbin/sysctl/sysctl.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index bb5c4c1..b712a26 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -533,7 +533,7 @@ show_var(int *oid, int nlen) case 'A': if (!nflag) printf("%s%s", name, sep); - printf("%s", p); + printf("%.*s", len, p); return (0); case 'I': |