-/* $OpenBSD: fgetln.c,v 1.12 2013/11/12 07:04:06 deraadt Exp $ */
+/* $OpenBSD: fgetln.c,v 1.13 2015/01/05 21:58:52 millert Exp $ */
/*-
* Copyright (c) 1990, 1993
* The Regents of the University of California. All rights reserved.
/*
* Expand the line buffer. Return -1 on error.
-#ifdef notdef
- * The `new size' does not account for a terminating '\0',
- * so we add 1 here.
-#endif
*/
static int
__slbexpand(FILE *fp, size_t newsize)
{
void *p;
-#ifdef notdef
- ++newsize;
-#endif
if (fp->_lb._size >= newsize)
return (0);
if ((p = realloc(fp->_lb._base, newsize)) == NULL)
}
*lenp = len;
ret = (char *)fp->_lb._base;
-#ifdef notdef
- ret[len] = '\0';
-#endif
FUNLOCKFILE(fp);
return (ret);
error:
- *lenp = 0; /* ??? */
FUNLOCKFILE(fp);
- return (NULL); /* ??? */
+ *lenp = 0;
+ return (NULL);
}