X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ffread.c;h=5c2357776dc71ccf983ee7015f9ff2b02824bf69;hb=7650390de8f72822ec0d4a9fb5b52efcf0be4698;hp=8105fe995d884ffeae8cf4b0492a8baef35e2905;hpb=e3cd6c5c265cd481db6e0c5b529855d99f0bda30;p=musl diff --git a/src/stdio/fread.c b/src/stdio/fread.c index 8105fe99..5c235777 100644 --- a/src/stdio/fread.c +++ b/src/stdio/fread.c @@ -21,14 +21,9 @@ size_t fread(void *destv, size_t size, size_t nmemb, FILE *f) l -= k; } - if (!l) { - FUNLOCK(f); - return nmemb; - } - /* Read the remainder directly */ for (; l; l-=k, dest+=k) { - k = f->read(f, dest, l); + k = __toread(f) ? 0 : f->read(f, dest, l); if (k+1<=1) { FUNLOCK(f); return (len-l)/size;