summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2002-02-26 16:06:00 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2002-02-26 16:06:00 +0000
commite1e761c3038a991cfa7a459cba09d295d5c2d759 (patch)
treea7cb6a5971b4177931822c1ae3ce18660bd7d6ef /mdk-stage1
parentb82f3f2e524743ec0b20fee9ac3531fa0d729712 (diff)
downloaddrakx-e1e761c3038a991cfa7a459cba09d295d5c2d759.tar
drakx-e1e761c3038a991cfa7a459cba09d295d5c2d759.tar.gz
drakx-e1e761c3038a991cfa7a459cba09d295d5c2d759.tar.bz2
drakx-e1e761c3038a991cfa7a459cba09d295d5c2d759.tar.xz
drakx-e1e761c3038a991cfa7a459cba09d295d5c2d759.zip
don't segfault when fclose(NULL)
Diffstat (limited to 'mdk-stage1')
-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