mirror of
git://git.musl-libc.org/musl
synced 2025-04-08 10:12:30 +00:00
fix fwrite return value when full write does not succeed
This commit is contained in:
parent
1af8c25504
commit
cea106fb89
@ -31,7 +31,7 @@ size_t fwrite(const void *src, size_t size, size_t nmemb, FILE *f)
|
|||||||
FLOCK(f);
|
FLOCK(f);
|
||||||
k = __fwritex(src, l, f);
|
k = __fwritex(src, l, f);
|
||||||
FUNLOCK(f);
|
FUNLOCK(f);
|
||||||
return k==l ? nmemb : l/size;
|
return k==l ? nmemb : k/size;
|
||||||
}
|
}
|
||||||
|
|
||||||
weak_alias(fwrite, fwrite_unlocked);
|
weak_alias(fwrite, fwrite_unlocked);
|
||||||
|
Loading…
Reference in New Issue
Block a user