LibC: fputs() shouldn't add a trailing newline, only puts().

This commit is contained in:
Andreas Kling 2019-01-23 16:24:39 +01:00
parent 1ee8597ce4
commit 1483af406f
Notes: sideshowbarker 2024-07-19 15:58:01 +09:00

View file

@ -164,12 +164,15 @@ int fputs(const char* s, FILE* stream)
if (rc == EOF)
return EOF;
}
return putc('\n', stream);
return 0;
}
int puts(const char* s)
{
return fputs(s, stdout);
int rc = fputs(s, stdout);
if (rc < 0)
return rc;
return fputc('\n', stdout);
}
void clearerr(FILE* stream)