diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-07-04 12:21:22 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-07-04 12:21:22 -0400 |
commit | 920baab81f98a3cae3436361cdd044afe21fe347 (patch) | |
tree | 91238819c21d0cb3c5a4555857e1645028027203 /src | |
parent | 98eddc677609c20796982f3171165700613e3cf2 (diff) | |
download | musl-920baab81f98a3cae3436361cdd044afe21fe347.tar.gz musl-920baab81f98a3cae3436361cdd044afe21fe347.tar.bz2 musl-920baab81f98a3cae3436361cdd044afe21fe347.tar.xz musl-920baab81f98a3cae3436361cdd044afe21fe347.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/stdio/putw.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/putw.c b/src/stdio/putw.c index a6d24292..0ff9d7fb 100644 --- a/src/stdio/putw.c +++ b/src/stdio/putw.c @@ -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; } |