diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-06-17 07:28:15 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-06-17 07:28:15 -0700 |
commit | 979724dafe047e78f0c6eff50be208a11b1ec547 (patch) | |
tree | 4e29634f339c554be2cb8f66d189df71bfb5af01 /buf.c | |
parent | 4f32b4b14f5986447dc3b732b101916412c91d22 (diff) | |
download | txr-979724dafe047e78f0c6eff50be208a11b1ec547.tar.gz txr-979724dafe047e78f0c6eff50be208a11b1ec547.tar.bz2 txr-979724dafe047e78f0c6eff50be208a11b1ec547.zip |
buffers: comment added in buf_shrink.
* buf.c (buf_shrink): It's not immediately obvious why len is
incremented by one if it is zero.
Diffstat (limited to 'buf.c')
-rw-r--r-- | buf.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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)); |