]> granicus.if.org Git - json-c/commitdiff
Drop the useless "char data[1]" from struct json_object. Fix a typo in a comment.
authorEric Haszlakiewicz <erh+git@nimenees.com>
Sat, 13 Jun 2020 18:25:32 +0000 (18:25 +0000)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Sat, 13 Jun 2020 18:25:32 +0000 (18:25 +0000)
json_object.c
json_object_private.h

index bed97cd0a378bb5ea50de5edf6d3c7f6275d85a2..8615ff51cf5c33beb9f84e87ee5ded12d56f178b 100644 (file)
@@ -199,7 +199,7 @@ static inline char *get_string_component_mutable(struct json_object *jso)
 {
        if (JC_STRING_C(jso)->len < 0)
        {
-               /* Due to json_object_str_string(), we might have a pointer */
+               /* Due to json_object_set_string(), we might have a pointer */
                return JC_STRING(jso)->c_string.pdata;
        }
        return JC_STRING(jso)->c_string.idata;
index 8132a3375f203d843fba001c8e8f837179592c7b..7cd90c2189d129ef62ef5b263ede9e24add06975 100644 (file)
@@ -47,7 +47,8 @@ struct json_object
        struct printbuf *_pb;
        json_object_delete_fn *_user_delete;
        void *_userdata;
-       char data[1]; // Actually the rest of a struct json_object_${o_type}
+       // Actually longer, always malloc'd as some more-specific type.
+       // The rest of a struct json_object_${o_type} follows
 };
 
 struct json_object_object