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.
This commit is contained in:
peter 2002-11-12 21:18:21 +00:00
parent b7191db17b
commit 06cee96130

View File

@ -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':