musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src/stdio/fread.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/fread.c')
-rw-r--r--src/stdio/fread.c 7
1 files changed, 1 insertions, 6 deletions
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;
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月15日 06:42:06 +0000

AltStyle によって変換されたページ (->オリジナル) /