mirror of
https://github.com/json-c/json-c.git
synced 2026-04-08 06:49:07 +08:00
Revert bogus change to json_object_get() made in f40b08d8 that caused it to always return NULL. (Issue #259)
Also undo NULL check in json_tokener_set_flags(): it's not at all valid toi try to set flags on a NULL pointer, and doing so should not be silently ignored.
This commit is contained in:
@@ -172,7 +172,7 @@ extern struct json_object* json_object_get(struct json_object *jso)
|
|||||||
{
|
{
|
||||||
if (jso)
|
if (jso)
|
||||||
jso->_ref_count++;
|
jso->_ref_count++;
|
||||||
return NULL;
|
return jso;
|
||||||
}
|
}
|
||||||
|
|
||||||
int json_object_put(struct json_object *jso)
|
int json_object_put(struct json_object *jso)
|
||||||
|
|||||||
@@ -979,5 +979,5 @@ struct json_object* json_tokener_parse_ex(struct json_tokener *tok,
|
|||||||
|
|
||||||
void json_tokener_set_flags(struct json_tokener *tok, int flags)
|
void json_tokener_set_flags(struct json_tokener *tok, int flags)
|
||||||
{
|
{
|
||||||
if(tok) tok->flags = flags;
|
tok->flags = flags;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user