diff options
author | 2016-02-11 16:14:16 +0100 | |
---|---|---|
committer | 2016-02-11 16:14:16 +0100 | |
commit | 6b3c3b1916b0af0494041c12a3c86819e441105e (patch) | |
tree | 4eac9853f62456d69211321ef7cb8c3819c20cdd /src/afm-run.c | |
parent | bf650bc39188c86cec8a11097f2c341e3f1b54b1 (diff) |
utils-json: refactoring
Change-Id: Ie8b49279e727afdbce7b9ea74c767d560c93af32
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/afm-run.c')
-rw-r--r-- | src/afm-run.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/afm-run.c b/src/afm-run.c index b9e1e7c..4e002e0 100644 --- a/src/afm-run.c +++ b/src/afm-run.c @@ -244,14 +244,14 @@ static int fill_launch_desc(struct json_object *appli, struct afm_launch_desc *d json_object *pub; /* main items */ - if(!j_object(appli, "public", &pub) - || !j_string(appli, "path", &desc->path) - || !j_string(appli, "id", &desc->tag) - || !j_string(appli, "content", &desc->content) - || !j_string(appli, "type", &desc->type) - || !j_string(pub, "name", &desc->name) - || !j_integer(pub, "width", &desc->width) - || !j_integer(pub, "height", &desc->height)) { + if(!j_read_object_at(appli, "public", &pub) + || !j_read_string_at(appli, "path", &desc->path) + || !j_read_string_at(appli, "id", &desc->tag) + || !j_read_string_at(appli, "content", &desc->content) + || !j_read_string_at(appli, "type", &desc->type) + || !j_read_string_at(pub, "name", &desc->name) + || !j_read_integer_at(pub, "width", &desc->width) + || !j_read_integer_at(pub, "height", &desc->height)) { errno = EINVAL; return -1; } |