minix/lib/stdio/puts.c

21 lines
321 B
C
Raw Normal View History

2005-04-21 16:53:53 +02:00
/*
* puts.c - print a string onto the standard output stream
*/
/* $Header$ */
#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;
}