From 5df2bcfe39f124451480cb3bc4c094c00392490f Mon Sep 17 00:00:00 2001 From: Tucker Evans Date: Wed, 9 Sep 2020 20:44:04 -0400 Subject: Fix change reallocarray calls to realloc The reallocarray calls were returning pointers that produced a segfault when dereferenced, not sure why but realloc seems to fix the issue. --- collections/vector/vector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collections/vector/vector.c b/collections/vector/vector.c index f14c302..d87ae76 100644 --- a/collections/vector/vector.c +++ b/collections/vector/vector.c @@ -79,7 +79,7 @@ vec *root; if (!root) return; - root->base = reallocarray(root->base, root->limit * 2, sizeof(void*)); + root->base = realloc(root->base, root->limit * 2 * sizeof(void*)); assert(root->base); } @@ -261,7 +261,7 @@ int n; for (i = root->limit; i < root->end + n; i*=2); - root->base = reallocarray(root->base, i, sizeof(void*)); + root->base = realloc(root->base, i * sizeof(void*)); } void vec_clear(root) -- cgit v1.1