From bffce29e27679f6f472e10b011f92817ca4e5b06 Mon Sep 17 00:00:00 2001 From: millert Date: Mon, 5 Jan 2015 21:58:52 +0000 Subject: [PATCH] Remove #ifdef notdef bits--we are not going to change the fgetln() API to NUL-terminate the buffer. --- lib/libc/stdio/fgetln.c | 16 +++------------- 1 file 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); } -- 2.20.1