summaryrefslogtreecommitdiff
path: root/StdLib/LibC/Stdio/fclose.c
diff options
context:
space:
mode:
Diffstat (limited to 'StdLib/LibC/Stdio/fclose.c')
-rw-r--r--StdLib/LibC/Stdio/fclose.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/StdLib/LibC/Stdio/fclose.c b/StdLib/LibC/Stdio/fclose.c
index 3745e20f94..1ce28bcab4 100644
--- a/StdLib/LibC/Stdio/fclose.c
+++ b/StdLib/LibC/Stdio/fclose.c
@@ -1,7 +1,7 @@
/** @file
Implementation of fclose as declared in <stdio.h>.
- Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials are licensed and made available
under the terms and conditions of the BSD License that accompanies this
distribution. The full text of the license may be found at
@@ -59,6 +59,10 @@ fclose(FILE *fp)
int r;
_DIAGASSERT(fp != NULL);
+ if(fp == NULL) {
+ errno = EINVAL;
+ return (EOF);
+ }
if (fp->_flags == 0) { /* not open! */
errno = EBADF;