From 2f34f0694f953fd00d2885b86634bbd618852fed Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Sat, 30 Jul 2016 23:39:14 +0200 Subject: Fix stuff --- src/lib/libc/stdio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/lib/libc/stdio.c') 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; -- cgit v1.2.3