diff options
Diffstat (limited to 'src/stdio')
-rw-r--r-- | src/stdio/fmemopen.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/stdio/fmemopen.c b/src/stdio/fmemopen.c index fb2656e3..5e0eeb50 100644 --- a/src/stdio/fmemopen.c +++ b/src/stdio/fmemopen.c @@ -112,6 +112,7 @@ FILE *fmemopen(void *restrict buf, size_t size, const char *restrict mode) if (!plus) f->f.flags = (*mode == 'r') ? F_NOWR : F_NORD; if (*mode == 'r') f->c.len = size; else if (*mode == 'a') f->c.len = f->c.pos = strnlen(buf, size); + else if (plus) *f->c.buf = 0; f->f.read = mread; f->f.write = mwrite; |