X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=lib%2Fgetndelim2.c;h=6f0868999525c671560ad97759abc0dec2de4cff;hb=22c1c15d0a29a1b7ea75456abe3f7062f835c887;hp=db81e1b29dbf9aeeed30203c20a764a14d1d75d3;hpb=bbc37b90fa1f1723658d7d9232f96e09b9363788;p=gnulib.git diff --git a/lib/getndelim2.c b/lib/getndelim2.c index db81e1b29..6f0868999 100644 --- a/lib/getndelim2.c +++ b/lib/getndelim2.c @@ -70,7 +70,7 @@ getndelim2 (char **lineptr, size_t *linesize, size_t nmax, { /* Here always *lineptr + *linesize == read_pos + nbytes_avail. */ - register int c = getc (stream); + register int c; /* We always want at least one char left in the buffer, since we always (unless we get an error while reading the first char) @@ -95,7 +95,8 @@ getndelim2 (char **lineptr, size_t *linesize, size_t nmax, } } - if (c == EOF || ferror (stream)) + c = getc (stream); + if (c == EOF) { /* Return partial line, if any. */ if (read_pos == *lineptr)