Skip to content

Commit

Permalink
Merge pull request #563 from robybeen/master
Browse files Browse the repository at this point in the history
Changed order of calloc args to match stdlib
  • Loading branch information
hawicz committed Apr 3, 2020
2 parents 6afcf16 + 5d9b8e0 commit ed54353
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arraylist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion json_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ed54353

Please sign in to comment.