summaryrefslogtreecommitdiff
path: root/StdLib/LibC/Stdio/feof.c
diff options
context:
space:
mode:
Diffstat (limited to 'StdLib/LibC/Stdio/feof.c')
-rw-r--r--StdLib/LibC/Stdio/feof.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/StdLib/LibC/Stdio/feof.c b/StdLib/LibC/Stdio/feof.c
index 70b5e5090e..7850e39268 100644
--- a/StdLib/LibC/Stdio/feof.c
+++ b/StdLib/LibC/Stdio/feof.c
@@ -2,7 +2,7 @@
Implementation of a subroutine version of the macro feof,
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
@@ -48,6 +48,7 @@
#include <assert.h>
#include <stdio.h>
+#include <errno.h>
#include "reentrant.h"
#include "local.h"
@@ -59,6 +60,10 @@ feof(FILE *fp)
int r;
_DIAGASSERT(fp != NULL);
+ if(fp == NULL) {
+ errno = EINVAL;
+ return (EOF);
+ }
FLOCKFILE(fp);
r = __sfeof(fp);