]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/LibC/Stdio/fwide.c
Add device abstraction code for the UEFI Console and UEFI Shell-based file systems.
[mirror_edk2.git] / StdLib / LibC / Stdio / fwide.c
index b89b7a3811cc1a4672b5a16f83011a1d8f8ba3c1..4ba1423eb2addf4ec354b8d03cc186629af9ff4b 100644 (file)
@@ -1,6 +1,13 @@
-/* $NetBSD: fwide.c,v 1.3 2005/06/12 05:21:27 lukem Exp $ */\r
+/*\r
+    Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
+    This program and the accompanying materials are licensed and made available\r
+    under the terms and conditions of the BSD License that accompanies this\r
+    distribution.  The full text of the license may be found at\r
+    http://opensource.org/licenses/bsd-license.\r
+\r
+    THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+    WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-/*-\r
  * Copyright (c)2001 Citrus Project,\r
  * All rights reserved.\r
  *\r
  * SUCH DAMAGE.\r
  *\r
  * $Citrus$\r
- */\r
+\r
+    NetBSD: fwide.c,v 1.3 2005/06/12 05:21:27 lukem Exp\r
+*/\r
 #include  <LibConfig.h>\r
 #include <sys/EfiCdefs.h>\r
-#if defined(LIBC_SCCS) && !defined(lint)\r
-__RCSID("$NetBSD: fwide.c,v 1.3 2005/06/12 05:21:27 lukem Exp $");\r
-#endif /* LIBC_SCCS and not lint */\r
 \r
 #include <assert.h>\r
+#include  <errno.h>\r
 #include <stdio.h>\r
 #include <wchar.h>\r
 #include "reentrant.h"\r
@@ -45,6 +52,10 @@ fwide(FILE *fp, int mode)
   struct wchar_io_data *wcio;\r
 \r
   _DIAGASSERT(fp != NULL);\r
+  if(fp == NULL) {\r
+    errno = EINVAL;\r
+    return (0);\r
+  }\r
 \r
   /*\r
    * this implementation use only -1, 0, 1\r