musl/src/stdio/putw.c
Rich Felker 920baab81f 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.
2012-07-04 12:21:22 -04:00

8 lines
112 B
C

#define _GNU_SOURCE
#include <stdio.h>
int putw(int x, FILE *f)
{
return (int)fwrite(&x, sizeof x, 1, f)-1;
}