diff options
author | Alex Auvolat <alex@adnab.me> | 2016-07-30 23:39:14 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2016-07-30 23:39:14 +0200 |
commit | 2f34f0694f953fd00d2885b86634bbd618852fed (patch) | |
tree | 2eabba74b136043596e0bc6e5148184a4e7da87b /src/lib | |
parent | f58f65c30de315d4419f69a92a708cbed797ff37 (diff) | |
download | kogata-2f34f0694f953fd00d2885b86634bbd618852fed.tar.gz kogata-2f34f0694f953fd00d2885b86634bbd618852fed.zip |
Fix stuff
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libc/stdio.c | 3 |
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; |