about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/stdio/fwrite.c2
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);