mirror of
https://github.com/json-c/json-c.git
synced 2026-11-05 21:20:16 +08:00
Merge pull request #978 from ManoharPaturi/fix-array-shrink-type-check
Assert the object type in json_object_array_shrink like every array accessor
This commit is contained in:
1 file changed
+1
@@ -1845,6 +1845,7 @@ static int json_array_equal(struct json_object *jso1, struct json_object *jso2)
|
||||
|
||||
int json_object_array_shrink(struct json_object *jso, int empty_slots)
|
||||
{
|
||||
assert(json_object_get_type(jso) == json_type_array);
|
||||
if (empty_slots < 0)
|
||||
json_abort("json_object_array_shrink called with negative empty_slots");
|
||||
return array_list_shrink(JC_ARRAY(jso)->c_array, empty_slots);
|
||||
|
||||
Reference in new issue
Block a user