From: Eric Haszlakiewicz Date: Sat, 13 Jun 2020 18:25:32 +0000 (+0000) Subject: Drop the useless "char data[1]" from struct json_object. Fix a typo in a comment. X-Git-Tag: json-c-0.15-20200726~34^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c10712114a79d1abf0d98ac165648a6aa36d45a;p=thirdparty%2Fjson-c.git Drop the useless "char data[1]" from struct json_object. Fix a typo in a comment. --- diff --git a/json_object.c b/json_object.c index bed97cd0..8615ff51 100644 --- a/json_object.c +++ b/json_object.c @@ -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; diff --git a/json_object_private.h b/json_object_private.h index 8132a337..7cd90c21 100644 --- a/json_object_private.h +++ b/json_object_private.h @@ -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