fgets() returns NULL at EOF??

Guy Harris guy at sun.uucp
Fri Sep 5 02:23:44 AEST 1986


> Better yet, return the number of characters read (so 0 on failure).

Better still, return the number of characters read, but return EOF on
failure; 1) this is what "fputs" does and 2) this encourages you to
distinguish between EOF and error, something that several UNIX utilities, to
their everlasting shame, do not do.
-- 
	Guy Harris
	{ihnp4, decvax, seismo, decwrl, ...}!sun!guy
	guy at sun.com (or guy at sun.arpa)



More information about the Comp.lang.c mailing list