diff --git a/photon/libc/stdio/fputs.c b/photon/libc/stdio/fputs.c index 3c31f3f..0737d0a 100644 --- a/photon/libc/stdio/fputs.c +++ b/photon/libc/stdio/fputs.c @@ -10,5 +10,10 @@ int fputs(const char *str, FILE *fp) } } + __fio_write(fp, "\n", 1); + if (__fio_error(fp)) { + return EOF; + } + return 0; } diff --git a/photon/libc/stdio/puts.c b/photon/libc/stdio/puts.c index 00b7a3e..9f17894 100644 --- a/photon/libc/stdio/puts.c +++ b/photon/libc/stdio/puts.c @@ -2,10 +2,5 @@ int puts(const char *str) { - int ret = fputs(str, stdout); - if (ret < 0) { - return ret; - } - - return fputc('\n', stdout); + return fputs(str, stdout); }