提交 920baab8 编写于 作者: R Rich Felker

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.
上级 98eddc67
......@@ -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;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册