summaryrefslogtreecommitdiff
path: root/lib/libc/stdio/getdelim.c
diff options
context:
space:
mode:
authorAndrey A. Chernov <ache@FreeBSD.org>2016-08-25 17:13:04 +0000
committerAndrey A. Chernov <ache@FreeBSD.org>2016-08-25 17:13:04 +0000
commit1bf6c5f18b105f62a472f7b7a524ca66ed1fe573 (patch)
treebdce9410c86bf1c9fb82f166e6bcffd194bbf07b /lib/libc/stdio/getdelim.c
parent8905590ba9cf344059a10fd400cdcaf84c4f4f2c (diff)
Notes
Diffstat (limited to 'lib/libc/stdio/getdelim.c')
-rw-r--r--lib/libc/stdio/getdelim.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdio/getdelim.c b/lib/libc/stdio/getdelim.c
index d7d5627ec92f..7e0b2e2b6edb 100644
--- a/lib/libc/stdio/getdelim.c
+++ b/lib/libc/stdio/getdelim.c
@@ -125,7 +125,7 @@ getdelim(char ** __restrict linep, size_t * __restrict linecapp, int delim,
if (fp->_r <= 0 && __srefill(fp)) {
/* If fp is at EOF already, we just need space for the NUL. */
- if (__sferror(fp) || expandtofit(linep, 1, linecapp))
+ if (!__sfeof(fp) || expandtofit(linep, 1, linecapp))
goto error;
FUNLOCKFILE(fp);
(*linep)[0] = '\0';
@@ -137,7 +137,7 @@ getdelim(char ** __restrict linep, size_t * __restrict linecapp, int delim,
if (sappend(linep, &linelen, linecapp, fp->_p, fp->_r))
goto error;
if (__srefill(fp)) {
- if (__sferror(fp))
+ if (!__sfeof(fp))
goto error;
goto done; /* hit EOF */
}