summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdio/fgetwln.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdio/fgetwln.c b/lib/libc/stdio/fgetwln.c
index 1b6c64c175a..37fcf3a1aee 100644
--- a/lib/libc/stdio/fgetwln.c
+++ b/lib/libc/stdio/fgetwln.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fgetwln.c,v 1.1 2015/01/12 20:58:07 millert Exp $ */
+/* $OpenBSD: fgetwln.c,v 1.2 2016/08/21 21:10:52 schwarze Exp $ */
/*-
* Copyright (c) 2002-2004 Tim J. Robbins.
@@ -67,7 +67,7 @@ fgetwln(FILE * __restrict fp, size_t *lenp)
if (wc == L'\n')
break;
}
- if (len == 0)
+ if (len == 0 || fp->_flags & __SERR)
goto error;
FUNLOCKFILE(fp);