bug fix: The new pointer returned from acl_arraylist_resize is ignored in acl_arraylist_append_ptr
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -68,4 +68,4 @@ _deps
|
||||
vgcore.*
|
||||
src/main.c
|
||||
.clangd
|
||||
./acl
|
||||
/acl
|
||||
|
||||
@ -35,7 +35,7 @@ void* acl_arraylist_append_ptr(void *arraylist_void, void **append_element) {
|
||||
union acl_arraylist_meta *arraylist = arraylist_void;
|
||||
--arraylist;
|
||||
if(arraylist->len == arraylist->cap) {
|
||||
acl_arraylist_resize(arraylist, 10);
|
||||
arraylist = acl_arraylist_resize(arraylist, 10);
|
||||
if(arraylist == NULL) return NULL;
|
||||
}
|
||||
*append_element = (char*)(arraylist + 1) + arraylist->sizeof_one_element * arraylist->len;
|
||||
|
||||
Reference in New Issue
Block a user