Merge branch '2.4'
This commit is contained in:
@@ -511,7 +511,7 @@ int json_array_remove(json_t *json, size_t index)
|
||||
|
||||
/* If we're removing the last element, nothing has to be moved */
|
||||
if(index < array->entries - 1)
|
||||
array_move(array, index, index + 1, array->entries - index);
|
||||
array_move(array, index, index + 1, array->entries - index - 1);
|
||||
|
||||
array->entries--;
|
||||
|
||||
|
||||
@@ -264,8 +264,8 @@ static void test_remove(void)
|
||||
if(json_array_size(array) != 8)
|
||||
fail("unable to append 8 items to array");
|
||||
|
||||
/* Remove the last element from a "full" array. */
|
||||
json_array_remove(array, 7);
|
||||
/* Remove an element from a "full" array. */
|
||||
json_array_remove(array, 5);
|
||||
|
||||
json_decref(five);
|
||||
json_decref(seven);
|
||||
|
||||
Reference in New Issue
Block a user