Really fix the off-by-one error in json_array_remove()
It didn't affect only the last element but all of them. One item too much was always moved.
This commit is contained in:
@@ -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