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 Wemm 2002-11-12 21:18:21 +00:00
parent e324564167
commit 9866352ec7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=106829

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