]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/LibC/Stdio/clrerr.c
StdLib/LibC/StdLib/Malloc.c: Revert cast removal to fix GCC build breakage.
[mirror_edk2.git] / StdLib / LibC / Stdio / clrerr.c
index bda0d04ce816686cf0414f746380b32f5183ac4c..469dc8c96a599735f2c29f9b0e3b6de2b6af8ff9 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
     Implementation of clearerr as declared in <stdio.h>.\r
 \r
-    Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\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
@@ -47,6 +47,7 @@
 \r
 #include <assert.h>\r
 #include <stdio.h>\r
+#include  <errno.h>\r
 #include "reentrant.h"\r
 #include "local.h"\r
 \r
 void\r
 clearerr(FILE *fp)\r
 {\r
-  //_DIAGASSERT(fp != NULL);\r
-\r
+  _DIAGASSERT(fp != NULL);\r
+  if(fp != NULL) {\r
   FLOCKFILE(fp);\r
   __sclearerr(fp);\r
   FUNLOCKFILE(fp);\r
+  }\r
 }\r