avoid using the deprecated is_error() function from json-c
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
fa73496098
commit
c8fc0897cd
2 changed files with 2 additions and 2 deletions
|
@ -76,7 +76,7 @@ static bool __blobmsg_add_json(struct blob_buf *b, json_object *obj)
|
||||||
{
|
{
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
|
|
||||||
if (is_error(obj))
|
if (!obj)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (json_object_get_type(obj) != json_type_object)
|
if (json_object_get_type(obj) != json_type_object)
|
||||||
|
|
2
jshn.c
2
jshn.c
|
@ -164,7 +164,7 @@ static int jshn_parse(const char *str)
|
||||||
json_object *obj;
|
json_object *obj;
|
||||||
|
|
||||||
obj = json_tokener_parse(str);
|
obj = json_tokener_parse(str);
|
||||||
if (is_error(obj) || json_object_get_type(obj) != json_type_object) {
|
if (!obj || json_object_get_type(obj) != json_type_object) {
|
||||||
fprintf(stderr, "Failed to parse message data\n");
|
fprintf(stderr, "Failed to parse message data\n");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue