diff --git a/Userspace/libc/include/stdio.h b/Userspace/libc/include/stdio.h index 3f155e2c..de19ab42 100644 --- a/Userspace/libc/include/stdio.h +++ b/Userspace/libc/include/stdio.h @@ -91,8 +91,8 @@ extern "C" int dprintf(int, const char *restrict, ...); int fclose(FILE *stream); FILE *fdopen(int, const char *); - int feof(FILE *); - int ferror(FILE *); + int feof(FILE *stream); + int ferror(FILE *stream); int fflush(FILE *stream); int fgetc(FILE *stream); int fgetpos(FILE *restrict, fpos_t *restrict); diff --git a/Userspace/libc/src/std/stdio.c b/Userspace/libc/src/std/stdio.c index 41293743..aeb77e3a 100644 --- a/Userspace/libc/src/std/stdio.c +++ b/Userspace/libc/src/std/stdio.c @@ -81,8 +81,20 @@ export int fclose(FILE *stream) } export FILE *fdopen(int, const char *); -export int feof(FILE *); -export int ferror(FILE *); + +export int feof(FILE *stream) +{ + if (!stream) + return 0; + return stream->eof; +} + +export int ferror(FILE *stream) +{ + if (!stream) + return 0; + return stream->error; +} export int fflush(FILE *stream) {