aboutsummaryrefslogtreecommitdiff
path: root/src/lib/libc
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2016-07-30 23:39:14 +0200
committerAlex Auvolat <alex@adnab.me>2016-07-30 23:39:14 +0200
commit2f34f0694f953fd00d2885b86634bbd618852fed (patch)
tree2eabba74b136043596e0bc6e5148184a4e7da87b /src/lib/libc
parentf58f65c30de315d4419f69a92a708cbed797ff37 (diff)
downloadkogata-2f34f0694f953fd00d2885b86634bbd618852fed.tar.gz
kogata-2f34f0694f953fd00d2885b86634bbd618852fed.zip
Fix stuff
Diffstat (limited to 'src/lib/libc')
-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;