summaryrefslogtreecommitdiff
path: root/StdLib/LibC/Stdio/fgetwc.c
diff options
context:
space:
mode:
Diffstat (limited to 'StdLib/LibC/Stdio/fgetwc.c')
-rw-r--r--StdLib/LibC/Stdio/fgetwc.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/StdLib/LibC/Stdio/fgetwc.c b/StdLib/LibC/Stdio/fgetwc.c
index 548192390d..f2159d7e41 100644
--- a/StdLib/LibC/Stdio/fgetwc.c
+++ b/StdLib/LibC/Stdio/fgetwc.c
@@ -1,4 +1,13 @@
/*-
+ 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
+ http://opensource.org/licenses/bsd-license.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
* Copyright (c)2001 Citrus Project,
* All rights reserved.
*
@@ -46,6 +55,10 @@ __fgetwc_unlock(FILE *fp)
size_t size;
_DIAGASSERT(fp != NULL);
+ if(fp == NULL) {
+ errno = ENOSTR;
+ return WEOF;
+ }
_SET_ORIENTATION(fp, 1);
wcio = WCIO_GET(fp);
@@ -91,6 +104,10 @@ fgetwc(FILE *fp)
wint_t r;
_DIAGASSERT(fp != NULL);
+ if(fp == NULL) {
+ errno = EINVAL;
+ return (WEOF);
+ }
FLOCKFILE(fp);
r = __fgetwc_unlock(fp);