X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ffputs.c;h=1cf344f28c6fe88a9394ef64ebe25ea0fbdcf74a;hb=9b132e556774c744f9052581d2d8d0fab417e97c;hp=e6bdb204ab0ffe8d3b7b5b028ba3552fc9f3ce55;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01;p=musl diff --git a/src/stdio/fputs.c b/src/stdio/fputs.c index e6bdb204..1cf344f2 100644 --- a/src/stdio/fputs.c +++ b/src/stdio/fputs.c @@ -1,10 +1,10 @@ #include "stdio_impl.h" +#include -int fputs(const char *s, FILE *f) +int fputs(const char *restrict s, FILE *restrict f) { size_t l = strlen(s); - if (!l) return 0; - return (int)fwrite(s, l, 1, f) - 1; + return (fwrite(s, 1, l, f)==l) - 1; } weak_alias(fputs, fputs_unlocked);