From f3a60ddeabcb41753bbfa7c3fb59486da41d3f4a Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 25 Oct 2015 12:09:28 +0000 Subject: According to POSIX, a write operation shall start at the current size of the stream (if mode had 'a' as the first character). MFC after: 1 week --- lib/libc/stdio/fmemopen.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libc/stdio/fmemopen.c') diff --git a/lib/libc/stdio/fmemopen.c b/lib/libc/stdio/fmemopen.c index ebd3596..bcf187d 100644 --- a/lib/libc/stdio/fmemopen.c +++ b/lib/libc/stdio/fmemopen.c @@ -149,6 +149,9 @@ fmemopen(void * __restrict buf, size_t size, const char * __restrict mode) return (NULL); } + if (mode[0] == 'a') + f->_flags |= __SAPP; + /* * Turn off buffering, so a write past the end of the buffer * correctly returns a short object count. -- cgit v1.1