mirror of
https://github.com/EnderIce2/Fennix.git
synced 2025-05-28 15:34:31 +00:00
fix(userspace/libc): wrong puts() implementation
The implementation didn't fully followed the POSIX.1-2024 standard "The puts() function shall write the string pointed to by s, followed by a <newline>, to the standard output stream stdout. The terminating null byte shall not be written." Signed-off-by: EnderIce2 <enderice2@protonmail.com>
This commit is contained in:
parent
451c5405e0
commit
659805960b
@ -455,7 +455,15 @@ export int putc(int c, FILE *stream) { return fputc(c, stream); }
|
|||||||
export int putchar(int c) { return putc(c, stdout); }
|
export int putchar(int c) { return putc(c, stdout); }
|
||||||
export int putc_unlocked(int c, FILE *stream) { return fputc(c, stream); }
|
export int putc_unlocked(int c, FILE *stream) { return fputc(c, stream); }
|
||||||
export int putchar_unlocked(int c) { return putc_unlocked(c, stdout); }
|
export int putchar_unlocked(int c) { return putc_unlocked(c, stdout); }
|
||||||
export int puts(const char *s) { return fputs(s, stdout); }
|
|
||||||
|
export int puts(const char *s)
|
||||||
|
{
|
||||||
|
if (fputs(s, stdout) == EOF)
|
||||||
|
return EOF;
|
||||||
|
if (fputc('\n', stdout) == EOF)
|
||||||
|
return EOF;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
export int remove(const char *);
|
export int remove(const char *);
|
||||||
export int rename(const char *, const char *);
|
export int rename(const char *, const char *);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user