1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-16 02:37:36 +00:00

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

View file

@ -164,12 +164,15 @@ int fputs(const char* s, FILE* stream)
if (rc == EOF) if (rc == EOF)
return EOF; return EOF;
} }
return putc('\n', stream); return 0;
} }
int puts(const char* s) 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) void clearerr(FILE* stream)