]> granicus.if.org Git - json-c/commitdiff
Changed order of calloc args to match stdlib
authorRobert <roby_p97@yahoo.com>
Thu, 2 Apr 2020 17:23:10 +0000 (19:23 +0200)
committerGitHub <noreply@github.com>
Thu, 2 Apr 2020 17:23:10 +0000 (19:23 +0200)
Although it is currently working, it's worth to stick with the stdlib definition to avoid further problems

json_object.c

index 96461641859cb38aa53101eb19ebfbcf8007f871..cb518afa80e43c499fc8f6cca781a0a8161fe51d 100644 (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;