From f70565325ec7cd60104dd3e4fad9d63f86274270 Mon Sep 17 00:00:00 2001 From: Andrew Pamment Date: Wed, 10 Oct 2018 11:12:04 +1000 Subject: [PATCH] fix bug in new ptr vector append --- src/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.c b/src/util.c index 4f846db..c25baa0 100644 --- a/src/util.c +++ b/src/util.c @@ -140,8 +140,8 @@ int ptr_vector_append(struct ptr_vector *vec, void *p) { vec->capacity *= 2; ps = realloc(vec->ptrs, vec->capacity * sizeof(void *)); assert(ps != NULL); - memset(vec->ptrs + oldcap, 0, (vec->capacity - oldcap) * sizeof(void *)); vec->ptrs = ps; + memset(vec->ptrs + oldcap, 0, (vec->capacity - oldcap) * sizeof(void *)); } vec->ptrs[vec->len] = p; ++vec->len;