changeset 354:3c9f47f4fd33

Fix bug spotted by Jean-Christphe Dubois: reserve space for null terminator.
author Rob Landley <rob@landley.net>
date Thu, 16 Apr 2009 17:03:38 -0500
parents 287bca550748
children f142d02036b6
files lib/lib.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lib/lib.c	Sun Mar 29 21:55:27 2009 -0500
+++ b/lib/lib.c	Thu Apr 16 17:03:38 2009 -0500
@@ -650,7 +650,7 @@
 
 	for (;;) {
 		if (1>read(fd, &c, 1)) break;
-		if (!(len & 63)) buf=xrealloc(buf, len+64);
+		if (!(len & 63)) buf=xrealloc(buf, len+65);
 		if ((buf[len++]=c) == end) break;
 	}
 	if (buf) buf[len]=0;