add assertion that triggers when cx_array_copy() stops working for NULL arrays

Fri, 01 Nov 2024 18:17:19 +0100

author
Mike Becker <universe@uap-core.de>
date
Fri, 01 Nov 2024 18:17:19 +0100
changeset 968
b5814aac3a76
parent 967
a58f602ed2fe
child 969
72e5432f6b42

add assertion that triggers when cx_array_copy() stops working for NULL arrays

src/array_list.c file | annotate | diff | comparison | revisions
--- a/src/array_list.c	Fri Nov 01 18:16:32 2024 +0100
+++ b/src/array_list.c	Fri Nov 01 18:17:19 2024 +0100
@@ -105,6 +105,7 @@
 
     // determine capacity
     size_t cap = capacity == NULL ? *size : *capacity;
+    assert(*target != NULL || cap == 0);
 
     // check if resize is required
     size_t minsize = index + elem_count;

mercurial