libc: Add more spacing to stdio.cpp

This commit is contained in:
apio 2022-10-22 12:21:04 +02:00
parent 6dc51abfc8
commit 063e2d5e7a

View File

@ -15,12 +15,14 @@ extern "C"
if (putchar('\n') < 0) return -1;
return nwritten + 1;
}
int fputs(const char* s, FILE* stream)
{
int result = (int)fwrite(s, strlen(s), 1, stream);
if (ferror(stream)) return -1;
return result;
}
int fputc(int c, FILE* stream)
{
char chr = (char)c;
@ -28,14 +30,17 @@ extern "C"
if (ferror(stream)) { return -1; }
return c;
}
int putc(int c, FILE* stream)
{
return fputc(c, stream);
}
int putchar(int c)
{
return fputc(c, stdout);
}
void perror(const char* s)
{
int savederr =
@ -43,6 +48,7 @@ extern "C"
if (s && *s) { fprintf(stderr, "%s: ", s); }
fprintf(stderr, "%s\n", strerror(savederr));
}
int remove(const char*)
{
NOT_IMPLEMENTED("remove");