Skip to content

Commit

Permalink
Changed order of calloc args to match stdlib (2)
Browse files Browse the repository at this point in the history
Although it is currently working, it's worth to stick with the stdlib definition to avoid further problems
  • Loading branch information
robybeen committed Apr 2, 2020
1 parent 56f8181 commit 5d9b8e0
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit 5d9b8e0

Please sign in to comment.