From 7fd4564b8acb60254817cb341b84c6468c8c6440 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Thu, 3 Jul 2014 23:39:21 +0200 Subject: [PATCH] plugin: fix parsing libexec plugin output Signed-off-by: Jo-Philipp Wich --- plugin.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/plugin.c b/plugin.c index 687944d..b75241a 100644 --- a/plugin.c +++ b/plugin.c @@ -108,12 +108,9 @@ rpc_plugin_call_finish_cb(struct blob_buf *blob, int stat, void *priv) { if (c->obj) { - if (json_object_get_type(c->obj) == json_type_object || - json_object_get_type(c->obj) == json_type_array) - { - blobmsg_add_json_element(blob, NULL, c->obj); + if (json_object_get_type(c->obj) == json_type_object && + blobmsg_add_object(blob, c->obj)) rv = UBUS_STATUS_OK; - } json_object_put(c->obj); } -- 2.25.1