commit | d6b2613a6ea39d97599b714eb6722745c71ab957 | [log] [tgz] |
---|---|---|
author | Rob Landley <rob@landley.net> | Thu Apr 16 17:03:38 2009 -0500 |
committer | Rob Landley <rob@landley.net> | Thu Apr 16 17:03:38 2009 -0500 |
tree | 69b078a148c5d75b8d510b1fb28c78f8a908f3de | |
parent | 25afd6548d9cd0ed3c9a3865c6ff73dbfd65f97d [diff] |
Fix bug spotted by Jean-Christphe Dubois: reserve space for null terminator.
diff --git a/lib/lib.c b/lib/lib.c index ecef64d..e4b9d8e 100644 --- a/lib/lib.c +++ b/lib/lib.c
@@ -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;