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:
Diffstat (limited to 'src/stdio/fwrite.c')
-rw-r--r--src/stdio/fwrite.c 1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/stdio/fwrite.c b/src/stdio/fwrite.c
index fa30c0d3..7a567b2c 100644
--- a/src/stdio/fwrite.c
+++ b/src/stdio/fwrite.c
@@ -28,6 +28,7 @@ size_t __fwritex(const unsigned char *restrict s, size_t l, FILE *restrict f)
size_t fwrite(const void *restrict src, size_t size, size_t nmemb, FILE *restrict f)
{
size_t k, l = size*nmemb;
+ if (!size) nmemb = 0;
FLOCK(f);
k = __fwritex(src, l, f);
FUNLOCK(f);
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月12日 07:09:08 +0000

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