diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-06-20 15:04:47 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-06-20 15:04:47 -0400 |
commit | cea106fb8976d04b916953469439bc58fa111266 (patch) | |
tree | faf571a86eb884e4d2c630660a24d5dc4fc71864 /src/stdio/fwrite.c | |
parent | 1af8c255040b3e1ba4913fd935d117490bfe8774 (diff) | |
download | musl-cea106fb8976d04b916953469439bc58fa111266.tar.gz musl-cea106fb8976d04b916953469439bc58fa111266.tar.bz2 musl-cea106fb8976d04b916953469439bc58fa111266.tar.xz musl-cea106fb8976d04b916953469439bc58fa111266.zip |
fix fwrite return value when full write does not succeed
Diffstat (limited to 'src/stdio/fwrite.c')
-rw-r--r-- | src/stdio/fwrite.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |