#219: fix off-by-one bug in cx_arl_remove()

Sun, 20 Nov 2022 17:47:26 +0100

author
Mike Becker <universe@uap-core.de>
date
Sun, 20 Nov 2022 17:47:26 +0100
changeset 626
254cc61c71a0
parent 625
a4c4a50c067a
child 627
cc8cbabd27cd

#219: fix off-by-one bug in cx_arl_remove()

src/array_list.c file | annotate | diff | comparison | revisions
--- a/src/array_list.c	Sun Nov 20 17:22:37 2022 +0100
+++ b/src/array_list.c	Sun Nov 20 17:47:26 2022 +0100
@@ -266,7 +266,7 @@
             index,
             ((char *) arl->data) + (index + 1) * list->itemsize,
             list->itemsize,
-            list->size - index,
+            list->size - index - 1,
             &arl->reallocator
     );
     if (result == 0) {

mercurial