From: Jo-Philipp Wich Date: Thu, 3 Jul 2014 21:39:21 +0000 (+0200) Subject: plugin: fix parsing libexec plugin output X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7fd4564b8acb60254817cb341b84c6468c8c6440;p=oweals%2Frpcd.git plugin: fix parsing libexec plugin output Signed-off-by: Jo-Philipp Wich --- 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); }