mirror of
https://github.com/json-c/json-c.git
synced 2026-04-09 15:29:07 +08:00
Merge pull request #563 from robybeen/master
Changed order of calloc args to match stdlib
This commit is contained in:
@@ -46,7 +46,7 @@ array_list_new(array_list_free_fn *free_fn)
|
|||||||
arr->size = ARRAY_LIST_DEFAULT_SIZE;
|
arr->size = ARRAY_LIST_DEFAULT_SIZE;
|
||||||
arr->length = 0;
|
arr->length = 0;
|
||||||
arr->free_fn = free_fn;
|
arr->free_fn = free_fn;
|
||||||
if(!(arr->array = (void**)calloc(sizeof(void*), arr->size))) {
|
if(!(arr->array = (void**)calloc(arr->size, sizeof(void*)))) {
|
||||||
free(arr);
|
free(arr);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ static struct json_object* json_object_new(enum json_type o_type)
|
|||||||
{
|
{
|
||||||
struct json_object *jso;
|
struct json_object *jso;
|
||||||
|
|
||||||
jso = (struct json_object*)calloc(sizeof(struct json_object), 1);
|
jso = (struct json_object*)calloc(1, sizeof(struct json_object));
|
||||||
if (!jso)
|
if (!jso)
|
||||||
return NULL;
|
return NULL;
|
||||||
jso->o_type = o_type;
|
jso->o_type = o_type;
|
||||||
|
|||||||
Reference in New Issue
Block a user