aboutsummaryrefslogtreecommitdiff
path: root/src/lib/libc/stdio.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/stdio.c')
-rw-r--r--src/lib/libc/stdio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/libc/stdio.c b/src/lib/libc/stdio.c
index 0d707ef..2872f62 100644
--- a/src/lib/libc/stdio.c
+++ b/src/lib/libc/stdio.c
@@ -228,7 +228,8 @@ void setlinebuf(FILE *stream) {
}
int setvbuf(FILE *stream, char *buf, int mode, size_t size) {
if (stream == NULL || stream->fd == 0
- || !(stream->file_mode & FM_WRITE)) return EOF;
+ || !(stream->file_mode & FM_WRITE)
+ || size == 0) return EOF;
if (fflush(stream) != 0) return EOF;