diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-01-23 16:24:39 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-01-23 16:24:39 +0100 |
commit | 1483af406f9c38a686c11ab1adffb46d81feb54b (patch) | |
tree | b236173ad2af6d9a848e1f2c6036ad08d748a0d5 /LibC/stdio.cpp | |
parent | 1ee8597ce4b36d2627892f6079e4d28f8dadc799 (diff) | |
download | serenity-1483af406f9c38a686c11ab1adffb46d81feb54b.zip |
LibC: fputs() shouldn't add a trailing newline, only puts().
Diffstat (limited to 'LibC/stdio.cpp')
-rw-r--r-- | LibC/stdio.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/LibC/stdio.cpp b/LibC/stdio.cpp index f4a34a8d07..6e75d52e5b 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) |