Skip to content
This repository has been archived by the owner on Nov 22, 2023. It is now read-only.

Commit

Permalink
fix arraylist_insert_at
Browse files Browse the repository at this point in the history
  • Loading branch information
NTDV committed Oct 22, 2022
1 parent fac4775 commit e89a042
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/stdix_arraylist.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ STATUS arraylist_insert_at(arraylist* list, const size_t index, int value) {
if ((state = arraylist_ensure_capacity(list, list->size + 1)) != OK) return state;
arraylist_shift(list->array + index, 1, list->size - index);
++(list->size);
} else {
state = OK;
}
list->array[index] = value;
return state;
Expand Down

0 comments on commit e89a042

Please sign in to comment.