/* Specification. */
#include "getndelim2.h"
-#if STDC_HEADERS
-# include <stdlib.h>
-#else
-char *malloc (), *realloc ();
-#endif
+#include <stdlib.h>
#include "unlocked-io.h"
{
/* 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)
}
}
- if (c == EOF || ferror (stream))
+ c = getc (stream);
+ if (c == EOF)
{
/* Return partial line, if any. */
if (read_pos == *lineptr)