mirror of
https://git.musl-libc.org/git/musl
synced 2025-02-14 09:14:20 +03:00
putw is supposed to return 0 (not the value written) on success
this is not a standard but it's the traditional behavior and it's more useful because the caller can reliably detect errors.
This commit is contained in:
parent
98eddc6776
commit
920baab81f
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user