From 1483af406f9c38a686c11ab1adffb46d81feb54b Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 23 Jan 2019 16:24:39 +0100 Subject: [PATCH] LibC: fputs() shouldn't add a trailing newline, only puts(). --- LibC/stdio.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/LibC/stdio.cpp b/LibC/stdio.cpp index f4a34a8d076..6e75d52e5be 100644 --- a/LibC/stdio.cpp +++ b/LibC/stdio.cpp @@ -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)