summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-03-06 14:59:25 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-03-06 14:59:25 -0800
commitfbb8a014d14fc8887529f344b128900dfc581a4d (patch)
treeb99418f7faf58ffe9090fa70e48f24172f154b10
parent68cf1642e9b1d0ae04f6bdeb6b7c8a2fd5ac5e9e (diff)
downloadtxr-fbb8a014d14fc8887529f344b128900dfc581a4d.tar.gz
txr-fbb8a014d14fc8887529f344b128900dfc581a4d.tar.bz2
txr-fbb8a014d14fc8887529f344b128900dfc581a4d.zip
Fix in chk_manage_vec resizing from zero.
* lib.c (bounding_pow_two): Eliminate bogus zero versus non-zero case check in return which causes the function to wrongly map 1 to 0, so that chk_manage_vec is then not able to adjust a vector to size 1.
-rw-r--r--lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib.c b/lib.c
index 2f8440e3..02861521 100644
--- a/lib.c
+++ b/lib.c
@@ -2346,7 +2346,7 @@ static size_t bounding_pow_two(size_t s)
s |= (t >> 16);
}
- return s ? s + 1 : s;
+ return s + 1;
}
mem_t *chk_manage_vec(mem_t *old, size_t oldfilled, size_t newfilled,