Quote Originally Posted by pianorain
Why not? You're telling fgets how much to read, not to look for a null delimiter. fgets stops reading on a new line, EOF, or when it hits count - 1.I could have sworn I already posted a link.
While it turns out it does read past the null, in my opinion, it shouldn't. It breaks the whole concept of a string in C. Which incidentally, is what the s there stands for.

If you want to read nulls, you should be using fread.


Quzah.