diff --git a/src/util.c b/src/util.c index cf542ca..877ddd7 100644 --- a/src/util.c +++ b/src/util.c @@ -116,8 +116,7 @@ void* vec_pop(struct Vector* vec) { if (vec->length == 0) return NULL; - vec->length--; - return vec->pages[vec->length]; + return vec->pages[--vec->length]; } void* vec_get(struct Vector* vec, uint32_t index) {