avoid using the deprecated is_error() function from json-c
authorFelix Fietkau <nbd@openwrt.org>
Tue, 23 Sep 2014 10:02:31 +0000 (12:02 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Tue, 23 Sep 2014 10:02:31 +0000 (12:02 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
blobmsg_json.c
jshn.c

index 8f208e0c5c62cc5544411d7b7aeb025ea2375152..5aa528bc338abbd0e7621931e421349f4e7ebca4 100644 (file)
@@ -76,7 +76,7 @@ static bool __blobmsg_add_json(struct blob_buf *b, json_object *obj)
 {
        bool ret = false;
 
-       if (is_error(obj))
+       if (!obj)
                return false;
 
        if (json_object_get_type(obj) != json_type_object)
diff --git a/jshn.c b/jshn.c
index cec48a0709c9f4dd149ecadac421e044422556a3..e7e02d19301f12fa158cb5a3bbe286e5d0850fd6 100644 (file)
--- a/jshn.c
+++ b/jshn.c
@@ -164,7 +164,7 @@ static int jshn_parse(const char *str)
        json_object *obj;
 
        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");
                return 1;
        }