| Message ID | 20260831080159.3552089-2-lordrasmus@gmail.com |
|---|---|
| State | New |
| Headers | show |
| Series | [uclibc-ng-devel,1/2] stdio: report the position as an open_memstream's size, as POSIX requires | expand |
diff --git a/libc/stdio/open_memstream.c b/libc/stdio/open_memstream.c index 7e8e2134f..716d8666e 100644 --- a/libc/stdio/open_memstream.c +++ b/libc/stdio/open_memstream.c @@ -188,6 +188,10 @@ FILE *open_memstream(char **bufloc, size_t *sizeloc) * nothing currently in the FILE's write buffer. */ if (fp != NULL) { + /* POSIX: "The stream associated with a call to + * open_memstream() shall be byte-oriented." fopencookie() + * leaves it unoriented. */ + __STDIO_STREAM_SET_NARROW(fp); __STDIO_STREAM_VALIDATE(fp); return fp; }