summaryrefslogtreecommitdiff
path: root/StdLib/LibC/Stdio/rewind.c
diff options
context:
space:
mode:
Diffstat (limited to 'StdLib/LibC/Stdio/rewind.c')
-rw-r--r--StdLib/LibC/Stdio/rewind.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/StdLib/LibC/Stdio/rewind.c b/StdLib/LibC/Stdio/rewind.c
index 4f2ab041a2..5d1042152b 100644
--- a/StdLib/LibC/Stdio/rewind.c
+++ b/StdLib/LibC/Stdio/rewind.c
@@ -1,11 +1,11 @@
/** @file
Implementation of rewind as declared in <stdio.h>.
- Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
+ 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.php.
+ 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.
@@ -56,8 +56,10 @@ rewind(FILE *fp)
{
_DIAGASSERT(fp != NULL);
+ if(fp != NULL) {
FLOCKFILE(fp);
(void) fseek(fp, 0L, SEEK_SET);
__sclearerr(fp);
FUNLOCKFILE(fp);
+ }
}