summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-07-03 23:39:21 +0200
committerJo-Philipp Wich <jow@openwrt.org>2014-07-04 00:06:43 +0200
commit7fd4564b8acb60254817cb341b84c6468c8c6440 (patch)
treece84990dccd99f7a39bc4320cfc2be4c2b55b143
parent3c55504336eb04a779515f0acff8ecbeea4a3d53 (diff)
downloadrpcd-7fd4564b8acb60254817cb341b84c6468c8c6440.tar.gz
plugin: fix parsing libexec plugin output
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
-rw-r--r--plugin.c7
1 files 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);
}