[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: standards/41992 (fgets returns non-NULL for a buffer size of 1 on an empty file)
Synopsis: fgets returns non-NULL for a buffer size of 1 on an empty file
Responsible-Changed-When: Fri, 04 Sep 2009 23:35:04 +0000
Local standards guru.
The behavior required by POSIX is questionable for the case of empty
buffer. Implementing the requirement for size=1 would require reading
from the stream, even though no input will be consumed. This can have
undesirable effects e.g. for pipes.
Looking at the implementation, the return value of NULL for size=0 also
Can you clarify if both of this is intentional and the correct behavior?
Main Index |
Thread Index |