gigatron/rom/Archive/lcc/Libs/stdio/puts.c
2025-01-28 19:17:01 +03:00

16 lines
317 B
C

#include <stdio.h>
/*
* Write the given string to stdout and appending a newline.
* Returns a nonnegative integer on success and EOF on error.
*/
int puts(const char *s)
{
for (; *s; s++)
if (putc(*s, stdout) < 0)
return EOF;
if (putc('\n', stdout) < 0)
return EOF;
return fflush(stdout);
}