summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/getdelim.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>2016-08-27 10:00:36 +0000
committerache <ache@FreeBSD.org>2016-08-27 10:00:36 +0000
commitc75c3e9c541aa8bba4dedbbdd694bcb9aafd5e81 (patch)
tree8d272b2d5f945b483ed43a8308114e478103523b /lib/libc/stdio/getdelim.c
parent82bfa7f4de819264453641e3d8bf043bf9ee4702 (diff)
downloadFreeBSD-src-c75c3e9c541aa8bba4dedbbdd694bcb9aafd5e81.zip
FreeBSD-src-c75c3e9c541aa8bba4dedbbdd694bcb9aafd5e81.tar.gz
MFC r304810
Don't check for __SERR which may stick from one of any previous stdio functions. __SERR is for user and the rest of stdio code do not check it for error sensing internally, only set it. In vf(w)printf.c here it is more easy to save __SERR, clear and restore it.
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 d7d5627..7e0b2e2 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 */
}
OpenPOWER on IntegriCloud