Unlike printf(3), fwrite(3) doesn't stop at the first NUL character
authorChris Pressey <cpressey@dragonflybsd.org>
Tue, 18 Jan 2005 03:13:52 +0000 (03:13 +0000)
committerChris Pressey <cpressey@dragonflybsd.org>
Tue, 18 Jan 2005 03:13:52 +0000 (03:13 +0000)
commit4b072af39f46256485ac7ed739dc142641c26f43
tree5a71c6698b0d64e9be7dec87978249c10cbc07d8
parent08b47a0d1e719f7065b699b90df7a3480bd84c80
Unlike printf(3), fwrite(3) doesn't stop at the first NUL character
it finds in the string; and since the full length of the string was
being passed to fwrite(3), sysctl(8) commands were mistakenly
outputting a NUL character after their text output.

Fix by only fwrite(3)ing the string up to the first NUL character.

Discovered-by: y0netan1
sbin/sysctl/sysctl.c