From: Rich Felker Date: Wed, 20 Jun 2012 19:04:47 +0000 (-0400) Subject: fix fwrite return value when full write does not succeed X-Git-Tag: v0.9.2~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cea106fb8976d04b916953469439bc58fa111266;p=musl fix fwrite return value when full write does not succeed --- diff --git a/src/stdio/fwrite.c b/src/stdio/fwrite.c index 02908c4b..1b8641ac 100644 --- a/src/stdio/fwrite.c +++ b/src/stdio/fwrite.c @@ -31,7 +31,7 @@ size_t fwrite(const void *src, size_t size, size_t nmemb, FILE *f) FLOCK(f); k = __fwritex(src, l, f); FUNLOCK(f); - return k==l ? nmemb : l/size; + return k==l ? nmemb : k/size; } weak_alias(fwrite, fwrite_unlocked);