Added binary and unicode file i/o support to msvcrt.
[reactos.git] / reactos / lib / crtdll / stdio / getw.c
index 54b93c5..7fb7594 100644 (file)
@@ -16,18 +16,20 @@ License along with the GNU C Library; see the file COPYING.LIB.  If
 not, write to the Free Software Foundation, Inc., 675 Mass Ave,
 Cambridge, MA 02139, USA.  */
 
-#include <crtdll/stdio.h>
+#include <msvcrt/stdio.h>
 
 
 /* Read a word (int) from STREAM.  */
-int
-_getw(FILE *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(w);
 }