summaryrefslogtreecommitdiffstats
path: root/4a-hal
diff options
context:
space:
mode:
authorJonathan Aillet <jonathan.aillet@iot.bzh>2018-06-08 11:16:48 +0200
committerJonathan Aillet <jonathan.aillet@iot.bzh>2018-10-08 15:52:51 +0200
commitc7ed18bbd20e1c1cbb9c753a7908c61dc5a23115 (patch)
treeda5c2c016dfb25df4d77cce79dde1d33fbb66e8a /4a-hal
parentf0cbf96720332f388b3effbaba84db462d8294e2 (diff)
Remove an unnecessary variable
Remove an unnecessary variable because it was used to get the result of a function call and to test this result (in a 'if' statment). So, to remove it, function was put directly into the 'if' statment. Change-Id: Ie79caa35b0873c6ec7cfdb19a25a3506c0082e53 Signed-off-by: Jonathan Aillet <jonathan.aillet@iot.bzh>
Diffstat (limited to '4a-hal')
-rw-r--r--4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
index 8de028d..cb91b4e 100644
--- a/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
+++ b/4a-hal/4a-hal-controllers/4a-hal-controllers-api-loader.c
@@ -185,7 +185,7 @@ int HalCtlsCreateApi(AFB_ApiT apiHandle, char *path, struct HalMgrData *HalMgrGl
int HalCtlsCreateAllApi(AFB_ApiT apiHandle, struct HalMgrData *HalMgrGlobalData)
{
- int index, err, status = 0;
+ int index, status = 0;
char *dirList, *fileName, *fullPath;
char filePath[CONTROL_MAXPATH_LEN];
@@ -215,8 +215,7 @@ int HalCtlsCreateAllApi(AFB_ApiT apiHandle, struct HalMgrData *HalMgrGlobalData)
for(index = 0; index < json_object_array_length(configJ); index++) {
entryJ = json_object_array_get_idx(configJ, index);
- err = wrap_json_unpack(entryJ, "{s:s, s:s !}", "fullpath", &fullPath, "filename", &fileName);
- if(err) {
+ if(wrap_json_unpack(entryJ, "{s:s, s:s !}", "fullpath", &fullPath, "filename", &fileName)) {
AFB_ApiError(apiHandle, "%s: HOOPs invalid JSON entry = %s", __func__, json_object_get_string(entryJ));
return -1;
}