this is not a standard but it's the traditional behavior and it's more useful because the caller can reliably detect errors.
@@ -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;
}