putw is supposed to return 0 (not the value written) on success
[musl] / src / stdio / putw.c
index a6d2429..0ff9d7f 100644 (file)
@@ -3,5 +3,5 @@
 
 int putw(int x, FILE *f)
 {
-       return fwrite(&x, sizeof x, 1, f) ? x : EOF;
+       return (int)fwrite(&x, sizeof x, 1, f)-1;
 }