1989-05-30 13:34:25 +00:00
|
|
|
/*
|
|
|
|
* puts.c - print a string onto the standard output stream
|
|
|
|
*/
|
|
|
|
/* $Header$ */
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
int
|
|
|
|
puts(register const char *s)
|
|
|
|
{
|
1989-12-18 15:04:14 +00:00
|
|
|
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;
|
1989-05-30 13:34:25 +00:00
|
|
|
}
|