Difference between fwrite(line, nread, 1, stdout)
and printf ("%s", line)
includes:
printf ("%s", line)
writes up to the 1st null character.
fwrite(line, nread, 1, stdout)
writes to length of input.
This differs when a null character was read and so using fwrite()
provides correct functionality in that pathological case.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…