summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/dietlibc/libstdio/fclose.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mdk-stage1/dietlibc/libstdio/fclose.c b/mdk-stage1/dietlibc/libstdio/fclose.c
index 6958a48e7..a955c6086 100644
--- a/mdk-stage1/dietlibc/libstdio/fclose.c
+++ b/mdk-stage1/dietlibc/libstdio/fclose.c
@@ -7,6 +7,8 @@ int fclose(FILE *stream) {
#ifdef WANT_BUFFERED_STDIO
FILE *f,*fl;
#endif
+ if (!stream)
+ return EOF;
fflush(stream);
res=close(stream->fd);
#ifdef WANT_BUFFERED_STDIO