ack/lang/cem/libcc.ansi/core/stdio/putw.c
2018-06-22 22:20:02 +02:00

21 lines
273 B
C

/*
* putw - write an word on a stream
*/
/* $Id$ */
#include <stdio.h>
int putw(int w, register FILE* stream)
{
register int cnt = sizeof(int);
register char* p = (char*)&w;
while (cnt--)
{
putc(*p++, stream);
}
if (ferror(stream))
return EOF;
return w;
}