Closed peanutbutterandcrackers closed 3 years ago
If I recall correctly, this is actually to remove the final newline character from fgets, not to add the null terminator.
I see. It could very well be. Well, I'm still learning, and thought this minor thing managed to slip through: hence the patch.
Anyways, closing this for now, then.
Also, thank you very much for the awesome book. I hope write some more books. You are a very engaging writer. And I'd love to read more books from you.
According to GNU/Linux man pages, fgets stores a "... terminating null byte ('\0') ... after the last character in the buffer" and strcpy "copies the string ... including the terminating null byte ('\0')"