summaryrefslogtreecommitdiff
path: root/StdLib/LibC/Stdio/refill.c
diff options
context:
space:
mode:
Diffstat (limited to 'StdLib/LibC/Stdio/refill.c')
-rw-r--r--StdLib/LibC/Stdio/refill.c35
1 files changed, 23 insertions, 12 deletions
diff --git a/StdLib/LibC/Stdio/refill.c b/StdLib/LibC/Stdio/refill.c
index e2d162375b..953e8f674a 100644
--- a/StdLib/LibC/Stdio/refill.c
+++ b/StdLib/LibC/Stdio/refill.c
@@ -1,6 +1,13 @@
-/* $NetBSD: refill.c,v 1.13 2003/08/07 16:43:30 agc 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) 1990, 1993
* The Regents of the University of California. All rights reserved.
*
@@ -30,19 +37,15 @@
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
- */
+
+ NetBSD: refill.c,v 1.13 2003/08/07 16:43:30 agc Exp
+ refill.c 8.1 (Berkeley) 6/4/93
+*/
#include <Uefi.h> // REMOVE, For DEBUG only
#include <Library/UefiLib.h> // REMOVE, For DEBUG only
#include <LibConfig.h>
#include <sys/EfiCdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)refill.c 8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: refill.c,v 1.13 2003/08/07 16:43:30 agc Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
#include <assert.h>
#include <errno.h>
@@ -61,7 +64,11 @@ static int
lflush(FILE *fp)
{
- //_DIAGASSERT(fp != NULL);
+ _DIAGASSERT(fp != NULL);
+ if(fp == NULL) {
+ errno = EINVAL;
+ return (EOF);
+ }
if ((fp->_flags & (__SLBF|__SWR)) == (__SLBF|__SWR))
return (__sflush(fp));
@@ -76,7 +83,11 @@ int
__srefill(FILE *fp)
{
- //_DIAGASSERT(fp != NULL);
+ _DIAGASSERT(fp != NULL);
+ if(fp == NULL) {
+ errno = EINVAL;
+ return (EOF);
+ }
/* make sure stdio is set up */
if (!__sdidinit)