aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdio/fgetwc_u.c
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/fgetwc_u.c')
-rw-r--r--newlib/libc/stdio/fgetwc_u.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/newlib/libc/stdio/fgetwc_u.c b/newlib/libc/stdio/fgetwc_u.c
index cbb9736..007f9c8 100644
--- a/newlib/libc/stdio/fgetwc_u.c
+++ b/newlib/libc/stdio/fgetwc_u.c
@@ -33,7 +33,8 @@ wint_t
_fgetwc_unlocked_r (struct _reent *ptr,
register FILE *fp)
{
- ORIENT(fp, 1);
+ if (ORIENT(fp, 1) != 1)
+ return WEOF;
return __fgetwc (ptr, fp);
}