diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2015-01-05 21:58:53 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2015-01-05 21:58:53 +0000 |
commit | 9a1e7200369344a5201d7241d694cde950539273 (patch) | |
tree | 87425db8cd4ec281b211995b51138552fcc7cb23 /lib | |
parent | e8d744b4662f0b4ee6968f73b4ae308dae516c7b (diff) |
Remove #ifdef notdef bits--we are not going to change the fgetln()
API to NUL-terminate the buffer.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/stdio/fgetln.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/lib/libc/stdio/fgetln.c b/lib/libc/stdio/fgetln.c index d0c0809be96..1109cf25c01 100644 --- a/lib/libc/stdio/fgetln.c +++ b/lib/libc/stdio/fgetln.c @@ -1,4 +1,4 @@ -/* $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. @@ -38,19 +38,12 @@ /* * 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) @@ -141,14 +134,11 @@ fgetln(FILE *fp, size_t *lenp) } *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); } |