__FBSDID("$FreeBSD: src/lib/libc/stdio/fgetln.c,v 1.11 2007/01/09 00:28:06 imp Exp $");
#include "namespace.h"
+#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#endif
if (fp->_lb._size >= newsize)
return (0);
+ if (newsize > INT_MAX) {
+ errno = ENOMEM;
+ return (-1);
+ }
if ((p = realloc(fp->_lb._base, newsize)) == NULL)
return (-1);
fp->_lb._base = p;
error:
*lenp = 0; /* ??? */
+ fp->_flags |= __SERR;
FUNLOCKFILE(fp);
return (NULL); /* ??? */
}