...
C99, Section 7.19.7.2, "The fgets() function", paragraph 3 says
The
fgetsfunction returnssif successful. If end-of-file is encountered and no characters have been read into the array, the contents of the array remain unchanged and a null pointer is returned.
...