ucx/list.c

changeset 115
e57ca2747782
parent 113
dde28a806552
--- a/ucx/list.c	Sun Dec 07 20:00:33 2025 +0100
+++ b/ucx/list.c	Sat Dec 13 15:58:58 2025 +0100
@@ -186,7 +186,11 @@
 }
 
 static int cx_pl_change_capacity(struct cx_list_s *list, size_t cap) {
-    return list->climpl->change_capacity(list, cap);
+    if (list->climpl->change_capacity == NULL) {
+        return 0;
+    } else {
+        return list->climpl->change_capacity(list, cap);
+    }
 }
 
 static struct cx_iterator_s cx_pl_iterator(
@@ -1026,7 +1030,7 @@
         CxIterator src_iter = cxListIterator(src);
         CxIterator other_iter = cxListIterator(other);
         while (cxIteratorValid(src_iter) || cxIteratorValid(other_iter)) {
-            void *src_elem, *other_elem;
+            void *src_elem = NULL, *other_elem = NULL;
             int d;
             if (!cxIteratorValid(src_iter)) {
                 other_elem = cxIteratorCurrent(other_iter);
@@ -1124,4 +1128,4 @@
         return 0;
     }
     return list->cl->change_capacity(list, cxCollectionSize(list));
-}
\ No newline at end of file
+}

mercurial