git://git.jankratochvil.net
/
reactos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
branch update for HEAD-2003021201
[reactos.git]
/
lib
/
msvcrt
/
stdio
/
getw.c
diff --git
a/lib/msvcrt/stdio/getw.c
b/lib/msvcrt/stdio/getw.c
index
119d4e1
..
6322abc
100644
(file)
--- a/
lib/msvcrt/stdio/getw.c
+++ b/
lib/msvcrt/stdio/getw.c
@@
-18,13
+18,18
@@
Cambridge, MA 02139, USA. */
#include <msvcrt/stdio.h>
#include <msvcrt/stdio.h>
+
/* Read a word (int) from STREAM. */
int _getw(FILE *stream)
{
int w;
/* Is there a better way? */
/* Read a word (int) from STREAM. */
int _getw(FILE *stream)
{
int w;
/* Is there a better way? */
- if (fread( &w, sizeof(w), 1, stream) != 1)
+ if (fread( &w, sizeof(w), 1, stream) != 1) {
+ // EOF is a legitimate integer value so users must
+ // check feof or ferror to verify an EOF return.
return(EOF);
return(EOF);
+ }
return(w);
}
return(w);
}
+