# HG changeset patch # User Mike Becker # Date 1633279011 -7200 # Node ID 8f7d3fe9ca40f070214f65afa91ac96a4909c004 # Parent 227c2eabbef83aa5c6465a1f09cb4f29f9b2b3f2 fix bad start index in cx_ll_node_at() diff -r 227c2eabbef8 -r 8f7d3fe9ca40 src/linked_list.c --- a/src/linked_list.c Sun Oct 03 16:30:47 2021 +0200 +++ b/src/linked_list.c Sun Oct 03 18:36:51 2021 +0200 @@ -109,7 +109,7 @@ if (index >= list->base.size) { return NULL; } else if (index > list->base.size / 2) { - return cx_linked_list_at(list->end, list->base.size, CX_LL_LOC_PREV, index); + return cx_linked_list_at(list->end, list->base.size-1, CX_LL_LOC_PREV, index); } else { return cx_linked_list_at(list->begin, 0, CX_LL_LOC_NEXT, index); }