diff options
Diffstat (limited to 'newlib/libc/stdio/getw.c')
-rw-r--r-- | newlib/libc/stdio/getw.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/newlib/libc/stdio/getw.c b/newlib/libc/stdio/getw.c index 210c5939a..b6fd87313 100644 --- a/newlib/libc/stdio/getw.c +++ b/newlib/libc/stdio/getw.c @@ -37,15 +37,14 @@ to get the next word from the file or stream identified by <[fp]>. As a side effect, <<getw>> advances the file's current position indicator. -RETURNS -The next word (read as an <<int>>), unless there is no more -data or the host system reports a read error; in either of these +RETURNS The next word (read as an <<int>>), unless there is no more +data, or the host system reports a read error; in either of these situations, <<getw>> returns <<EOF>>. Since <<EOF>> is a valid <<int>>, you must use <<ferror>> or <<feof>> to distinguish these situations. PORTABILITY -<<getw>> is a remnant of K&R C; it is not part of any ISO C Standard. +<<getw>> is a remnant of K&R C, it is not part of any ISO C Standard. <<fread>> should be used instead. In fact, this implementation of <<getw>> is based upon <<fread>>. @@ -55,15 +54,14 @@ Supporting OS subroutines required: <<fread>>. */ static char sccsid[] = "%W% (Berkeley) %G%"; #endif /* LIBC_SCCS and not lint */ -#include <_ansi.h> #include <stdio.h> int -_DEFUN(getw, (fp), - register FILE *fp) +getw (fp) + register FILE *fp; { int result; - if (fread ((char*)&result, sizeof (result), 1, fp) != 1) + if (fread((char*)&result, sizeof(result), 1, fp) != 1) return EOF; return result; } |