diff options
author | 2016-08-21 21:10:52 +0000 | |
---|---|---|
committer | 2016-08-21 21:10:52 +0000 | |
commit | a59c12ce67192d97f3724c2c29a863b3ce5aef5e (patch) | |
tree | 9e9984049dda9e97ec3db67f7750e17f2777fa30 /lib/libc/stdio/fgetwln.c | |
parent | Make lease_value() unescape quoted strings. To be fully compliant, we (diff) | |
download | wireguard-openbsd-a59c12ce67192d97f3724c2c29a863b3ce5aef5e.tar.xz wireguard-openbsd-a59c12ce67192d97f3724c2c29a863b3ce5aef5e.zip |
bugfix: when fgetwc(3) fails, fgetwln(3) must fail as well;
OK jca@ martijn@ millert@
Diffstat (limited to 'lib/libc/stdio/fgetwln.c')
-rw-r--r-- | lib/libc/stdio/fgetwln.c | 4 |
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); |