json_object_object_add_ex() should have shared code with json_object_object_add(), and been changed to return int at the same time the latter was. Do that now.

Also correct a couple of calls to _to_json_string to check the return value.
This commit is contained in:
Eric Haszlakiewicz
2016-08-20 22:35:29 -04:00
parent e40505e489
commit c4d060bf80
2 changed files with 12 additions and 27 deletions

View File

@@ -385,7 +385,7 @@ extern int json_object_object_add(struct json_object* obj, const char *key,
* @param opts process-modifying options. To specify multiple options, use
* arithmetic or (OPT1|OPT2)
*/
extern void json_object_object_add_ex(struct json_object* obj, const char *key,
extern int json_object_object_add_ex(struct json_object* obj, const char *key,
struct json_object *val, const unsigned opts);
/** Get the json_object associate with a given object field.