diff --git a/src/stdio/fmemopen.c b/src/stdio/fmemopen.c index fb2656e3ad19d16d623b9be3f1e5b49a1ef2533b..5e0eeb50d44865398f90f39cf5416282d3b8b0fe 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;