summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--buf.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/buf.c b/buf.c
index 910d7801..ce196976 100644
--- a/buf.c
+++ b/buf.c
@@ -175,7 +175,7 @@ static void buf_shrink(struct buf *b)
val len = b->len;
if (len == zero)
- len = succ(len);
+ len = succ(len); /* avoid reallocing to zero length; i.e. freeing */
if (len != b->size) {
b->data = chk_realloc(b->data, c_num(len));