diff -r 820ee59121b4 -r 85c08391a090 src/array_list.c --- a/src/array_list.c Thu Nov 17 18:29:59 2022 +0100 +++ b/src/array_list.c Thu Nov 17 18:32:59 2022 +0100 @@ -190,7 +190,29 @@ struct cx_list_s *list, size_t index ) { - return 1; + /* out-of-bounds check */ + if (index >= list->size) { + return 1; + } + + cx_array_list *arl = (cx_array_list *) list; + + /* just move the elements starting at index to the left */ + int result = cx_array_copy( + &arl->data, + &list->size, + &list->capacity, + index, + ((char *) arl->data) + (index + 1) * list->itemsize, + list->itemsize, + list->size - index, + &arl->reallocator + ); + if (result == 0) { + /* decrease the size */ + list->size--; + } + return result; } static void *cx_arl_at(