Browse Source

Drop the useless "char data[1]" from struct json_object. Fix a typo in a comment.

tags/json-c-0.15-20200726
Eric Haszlakiewicz 5 years ago
parent
commit
4c10712114
2 changed files with 3 additions and 2 deletions
  1. +1
    -1
      json_object.c
  2. +2
    -1
      json_object_private.h

+ 1
- 1
json_object.c View File

@@ -199,7 +199,7 @@ static inline char *get_string_component_mutable(struct json_object *jso)
{ {
if (JC_STRING_C(jso)->len < 0) 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.pdata;
} }
return JC_STRING(jso)->c_string.idata; return JC_STRING(jso)->c_string.idata;


+ 2
- 1
json_object_private.h View File

@@ -47,7 +47,8 @@ struct json_object
struct printbuf *_pb; struct printbuf *_pb;
json_object_delete_fn *_user_delete; json_object_delete_fn *_user_delete;
void *_userdata; 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 struct json_object_object


Loading…
Cancel
Save