This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/13151] New: fmemopen streams fail to read eof
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Mon, 05 Sep 2011 02:24:22 +0000
- Subject: [Bug libc/13151] New: fmemopen streams fail to read eof
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=13151
Bug #: 13151
Summary: fmemopen streams fail to read eof
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: libc
AssignedTo: drepper.fsp@gmail.com
ReportedBy: bugdal@aerifal.cx
Classification: Unclassified
Streams obtained by fmemopen fail to yield EOF when attempting to read past the
"current size" of the buffer. Minimal failure case:
FILE *f = fmemopen((char[10]){"hello"}, 10, "a+");
assert(getc(f)==EOF);
(The "current size" established by opening in append mode is the offset of the
null byte, 5.)
Reference:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/fmemopen.html
I understand that the GNU fmemopen predated the standardized function, and I'm
not sure what politics were involved in writing the standard such that the
existing GNU version did not conform. Nonetheless, this should be fixed. If you
want to keep the original GNU behavior, there should be a separate
__posix_fmemopen that gets used when _POSIX_C_SOURCE >= 200809L.
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.