Mon, 22 Dec 2025 16:59:48 +0100
revert incorrect use of elem_size argument in cxArrayListCreate()
| src/array_list.c | file | annotate | diff | comparison | revisions | |
| src/list.c | file | annotate | diff | comparison | revisions |
--- a/src/array_list.c Mon Dec 22 16:45:58 2025 +0100 +++ b/src/array_list.c Mon Dec 22 16:59:48 2025 +0100 @@ -1077,7 +1077,8 @@ list->capacity = initial_capacity; // allocate the array after the real elem_size is known - list->data = cxCalloc(allocator, initial_capacity, elem_size); + list->data = cxCalloc(allocator, initial_capacity, + list->base.collection.elem_size); if (list->data == NULL) { // LCOV_EXCL_START cxFree(allocator, list); return NULL;
--- a/src/list.c Mon Dec 22 16:45:58 2025 +0100 +++ b/src/list.c Mon Dec 22 16:59:48 2025 +0100 @@ -147,8 +147,7 @@ const char *src = data; size_t i = 0; for (; i < n; i++) { - if (NULL == list->cl->insert_element(list, index + i, src) - ) { + if (NULL == list->cl->insert_element(list, index + i, src)) { return i; // LCOV_EXCL_LINE } if (src != NULL) {