...
See STR00-C. Represent characters using an appropriate type for more information on the proper use of character types.
C provides the provides feof() and ferror() to detect end-of-file and file errors. These functions are not subject to the problems associated with character and integer sizes, and are preferred over EOF or WEOF [Kettlewell 2002].
...