diff options
author | ache <ache@FreeBSD.org> | 2015-10-25 12:09:28 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2015-10-25 12:09:28 +0000 |
commit | f3a60ddeabcb41753bbfa7c3fb59486da41d3f4a (patch) | |
tree | 03ef549a24b60465d2fcb1b17c3f3799313b780a /lib/libc | |
parent | 602679883920819b09fc6a283d74b9e6be55af03 (diff) | |
download | FreeBSD-src-f3a60ddeabcb41753bbfa7c3fb59486da41d3f4a.zip FreeBSD-src-f3a60ddeabcb41753bbfa7c3fb59486da41d3f4a.tar.gz |
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
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/stdio/fmemopen.c | 3 |
1 files changed, 3 insertions, 0 deletions
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. |