summaryrefslogtreecommitdiff
path: root/StdLib/LibC/Stdio/fputwc.c
diff options
context:
space:
mode:
Diffstat (limited to 'StdLib/LibC/Stdio/fputwc.c')
-rw-r--r--StdLib/LibC/Stdio/fputwc.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/StdLib/LibC/Stdio/fputwc.c b/StdLib/LibC/Stdio/fputwc.c
index 49f6702227..8bbd407362 100644
--- a/StdLib/LibC/Stdio/fputwc.c
+++ b/StdLib/LibC/Stdio/fputwc.c
@@ -1,6 +1,13 @@
-/* $NetBSD: fputwc.c,v 1.4 2005/06/12 05:21:27 lukem Exp $ */
+/*
+ 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.
*
@@ -26,12 +33,11 @@
* SUCH DAMAGE.
*
* $Citrus$
- */
+
+NetBSD: fputwc.c,v 1.4 2005/06/12 05:21:27 lukem Exp
+*/
#include <LibConfig.h>
#include <sys/EfiCdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: fputwc.c,v 1.4 2005/06/12 05:21:27 lukem Exp $");
-#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <errno.h>
@@ -53,6 +59,10 @@ __fputwc_unlock(wchar_t wc, FILE *fp)
struct __siov iov;
_DIAGASSERT(fp != NULL);
+ if(fp == NULL) {
+ errno = EINVAL;
+ return (WEOF);
+ }
/* LINTED we don't play with buf */
iov.iov_base = (void *)buf;
@@ -91,6 +101,10 @@ fputwc(wchar_t wc, FILE *fp)
wint_t r;
_DIAGASSERT(fp != NULL);
+ if(fp == NULL) {
+ errno = EINVAL;
+ return (WEOF);
+ }
FLOCKFILE(fp);
r = __fputwc_unlock(wc, fp);