X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ffwrite.c;h=8027b3061469414d3595d6801f3b4305e3c4499b;hb=400c5e5c8307a2ebe44ef1f203f5a15669f20347;hp=02908c4b9ad39176d4b5f6591a0b3d72518d20d5;hpb=e3cd6c5c265cd481db6e0c5b529855d99f0bda30;p=musl diff --git a/src/stdio/fwrite.c b/src/stdio/fwrite.c index 02908c4b..8027b306 100644 --- a/src/stdio/fwrite.c +++ b/src/stdio/fwrite.c @@ -1,6 +1,6 @@ #include "stdio_impl.h" -size_t __fwritex(const unsigned char *s, size_t l, FILE *f) +size_t __fwritex(const unsigned char *restrict s, size_t l, FILE *restrict f) { size_t i=0; @@ -24,14 +24,14 @@ size_t __fwritex(const unsigned char *s, size_t l, FILE *f) return l+i; } -size_t fwrite(const void *src, size_t size, size_t nmemb, FILE *f) +size_t fwrite(const void *restrict src, size_t size, size_t nmemb, FILE *restrict f) { size_t k, l = size*nmemb; if (!l) return l; 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);