Skip to content

Commit 3f26899

Browse files
committed
Update json.c
Although the original version works as expected, the argument order should be changed to calloc's signature: void* calloc (size_t num, size_t size); http://www.cplusplus.com/reference/cstdlib/calloc/
1 parent 1d8bdc8 commit 3f26899

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

json.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ typedef struct
7878

7979
static void * default_alloc (size_t size, int zero, void * user_data)
8080
{
81-
return zero ? calloc (size, 1) : malloc (size);
81+
return zero ? calloc (1, size) : malloc (size);
8282
}
8383

8484
static void default_free (void * ptr, void * user_data)

0 commit comments

Comments
 (0)