Work around fgets()'s lack of length reporting
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Stop losing \0s from the end of files because we don't know how much fgets() read into our buffer. If we prefill the buffer with anything other than zeroes, we can actually tell the difference between the terminator and unused space in the buffer. This is possibly more expensive, but at least it should be correct. Fixes #1504
authored by Muh Muhten · committed by Nico Williams · parent 048acee · Browse files · 1 file+9 added−7 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+9 added−7 removed
- other:+9 added−7 removed