author | Rich Felker <dalias@aerifal.cx> | 2018年02月24日 10:51:16 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2018年02月24日 10:51:16 -0500 |
commit | f92804188eb464536d638548e51e835b6c49e373 (patch) | |
tree | b5f290463be7b7adbe63d1b2ed9544102591a1a7 /src/stdio/fread.c | |
parent | 9bf9c732f9d39d691e1f8841e7204c9c26321946 (diff) | |
download | musl-f92804188eb464536d638548e51e835b6c49e373.tar.gz |
-rw-r--r-- | src/stdio/fread.c | 2 |
diff --git a/src/stdio/fread.c b/src/stdio/fread.c index aef75f73..733d3716 100644 --- a/src/stdio/fread.c +++ b/src/stdio/fread.c @@ -25,7 +25,7 @@ size_t fread(void *restrict destv, size_t size, size_t nmemb, FILE *restrict f) /* Read the remainder directly */ for (; l; l-=k, dest+=k) { k = __toread(f) ? 0 : f->read(f, dest, l); - if (k+1<=1) { + if (!k) { FUNLOCK(f); return (len-l)/size; } |