mirror of
https://github.com/json-c/json-c.git
synced 2026-03-29 09:59:06 +08:00
Fixed json_object_object_add().
* Return value of json_object_object_add() changed from void to int. Return value now indicates success or failure. * Check whether allocations are successful. * Do not exit program from within the library.
This commit is contained in:
@@ -230,8 +230,11 @@ extern struct lh_table* json_object_get_object(struct json_object *obj);
|
||||
* @param obj the json_object instance
|
||||
* @param key the object field name (a private copy will be duplicated)
|
||||
* @param val a json_object or NULL member to associate with the given field
|
||||
*
|
||||
* @return On success, <code>0</code> is returned.
|
||||
* On error, a negative value is returned.
|
||||
*/
|
||||
extern void json_object_object_add(struct json_object* obj, const char *key,
|
||||
extern int json_object_object_add(struct json_object* obj, const char *key,
|
||||
struct json_object *val);
|
||||
|
||||
/** Get the json_object associate with a given object field
|
||||
|
||||
Reference in New Issue
Block a user