author | Rich Felker <dalias@aerifal.cx> | 2018年07月13日 21:56:27 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018年07月13日 21:56:27 -0400 |
commit | 9cad27a3dc1a4eb349b6591e4dc8cc89dce32277 (patch) | |
tree | 9346b3dd848090b935d466385c006fdd86263ceb /src/stdio/setvbuf.c | |
parent | 062015204a192dd6ab9663abcc3171b9106d1749 (diff) | |
download | musl-9cad27a3dc1a4eb349b6591e4dc8cc89dce32277.tar.gz |
-rw-r--r-- | src/stdio/setvbuf.c | 2 |
diff --git a/src/stdio/setvbuf.c b/src/stdio/setvbuf.c index b6b9b018..06ea296c 100644 --- a/src/stdio/setvbuf.c +++ b/src/stdio/setvbuf.c @@ -14,7 +14,7 @@ int setvbuf(FILE *restrict f, char *restrict buf, int type, size_t size) f->buf_size = 0; } else { if (buf && size >= UNGET) { - f->buf = (void *)buf; + f->buf = (void *)(buf + UNGET); f->buf_size = size - UNGET; } if (type == _IOLBF && f->buf_size) |