projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
98eddc6
)
putw is supposed to return 0 (not the value written) on success
author
Rich Felker
<dalias@aerifal.cx>
Wed, 4 Jul 2012 16:21:22 +0000
(12:21 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Wed, 4 Jul 2012 16:21:22 +0000
(12:21 -0400)
this is not a standard but it's the traditional behavior and it's more
useful because the caller can reliably detect errors.
src/stdio/putw.c
patch
|
blob
|
history
diff --git
a/src/stdio/putw.c
b/src/stdio/putw.c
index
a6d2429
..
0ff9d7f
100644
(file)
--- 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
;
}