Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Feb 2019 23:17:44 +0000 (UTC)
From:      Brooks Davis <brooks@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r343884 - head/lib/libc/stdio
Message-ID:  <201902072317.x17NHixb034850@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: brooks
Date: Thu Feb  7 23:17:44 2019
New Revision: 343884
URL: https://svnweb.freebsd.org/changeset/base/343884

Log:
  GC a historical artifact.
  
  Back in 1993, the fgetln (then fgetline) interface was changed to not
  return a C string.  The change was accomplished by ifdefing out the code
  that did the termination.  Changing the interface would violate our API
  stability rules so remove the old implementation.
  
  Sponsored by:	DARPA, AFRL

Modified:
  head/lib/libc/stdio/fgetln.c

Modified: head/lib/libc/stdio/fgetln.c
==============================================================================
--- head/lib/libc/stdio/fgetln.c	Thu Feb  7 22:49:49 2019	(r343883)
+++ head/lib/libc/stdio/fgetln.c	Thu Feb  7 23:17:44 2019	(r343884)
@@ -50,19 +50,12 @@ __FBSDID("$FreeBSD$");
 
 /*
  * 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
  */
 int
 __slbexpand(FILE *fp, size_t newsize)
 {
 	void *p;
 
-#ifdef notdef
-	++newsize;
-#endif
 	if (fp->_lb._size >= newsize)
 		return (0);
 	if (newsize > INT_MAX) {
@@ -160,9 +153,6 @@ fgetln(FILE *fp, size_t *lenp)
 		break;
 	}
 	*lenp = len;
-#ifdef notdef
-	fp->_lb._base[len] = '\0';
-#endif
 	ret = (char *)fp->_lb._base;
 end:
 	FUNLOCKFILE_CANCELSAFE();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902072317.x17NHixb034850>