diff options
author | Tucker Evans <tuckerevans24@gmail.com> | 2020-09-09 20:44:04 -0400 |
---|---|---|
committer | Tucker Evans <tuckerevans24@gmail.com> | 2020-09-09 20:44:04 -0400 |
commit | 5df2bcfe39f124451480cb3bc4c094c00392490f (patch) | |
tree | c53de24301f4d9a724bc2f4dcb1ea243401936c0 | |
parent | a86fba22d9607316e29b5f7e073f2b8b76f0d3d1 (diff) |
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.
-rw-r--r-- | collections/vector/vector.c | 4 |
1 files 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) |