ack/lang/cem/libcc.ansi/stdio/puts.c
2018-06-21 22:33:47 +02:00

24 lines
326 B
C

/*
* puts.c - print a string onto the standard output stream
*/
/* $Id$ */
#include <stdio.h>
int puts(register const char* s)
{
register FILE* file = stdout;
register int i = 0;
while (*s)
{
if (putc(*s++, file) == EOF)
return EOF;
else
i++;
}
if (putc('\n', file) == EOF)
return EOF;
return i + 1;
}