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/fwrite.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012年06月20日 15:04:47 -0400
committerRich Felker <dalias@aerifal.cx>2012年06月20日 15:04:47 -0400
commitcea106fb8976d04b916953469439bc58fa111266 (patch)
treefaf571a86eb884e4d2c630660a24d5dc4fc71864 /src/stdio/fwrite.c
parent1af8c255040b3e1ba4913fd935d117490bfe8774 (diff)
downloadmusl-cea106fb8976d04b916953469439bc58fa111266.tar.gz
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);
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月11日 20:21:29 +0000

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