Browse Source

Merge pull request #563 from robybeen/master

Changed order of calloc args to match stdlib
tags/json-c-0.14-20200419
Eric Haszlakiewicz GitHub 5 years ago
parent
commit
ed54353d84
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions
  1. +1
    -1
      arraylist.c
  2. +1
    -1
      json_object.c

+ 1
- 1
arraylist.c View File

@@ -46,7 +46,7 @@ array_list_new(array_list_free_fn *free_fn)
arr->size = ARRAY_LIST_DEFAULT_SIZE;
arr->length = 0;
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);
return NULL;
}


+ 1
- 1
json_object.c View File

@@ -228,7 +228,7 @@ static struct json_object* json_object_new(enum json_type o_type)
{
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)
return NULL;
jso->o_type = o_type;


Loading…
Cancel
Save