NetBSD-Bugs archive

[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-From-To: lib-bug-people->kleink
Responsible-Changed-By: joerg%NetBSD.org@localhost
Responsible-Changed-When: Fri, 04 Sep 2009 23:35:04 +0000
Responsible-Changed-Why:
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
seems questionable.

Can you clarify if both of this is intentional and the correct behavior?





Home | Main Index | Thread Index | Old Index