aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-14 19:35:39 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-09-14 19:35:57 +0200
commit49a99fef3e1e1ea0ecd7f131fd56da4c54bcd146 (patch)
tree6f3fd5922d9a2e019494ecf26d7bd62a1b12b64b
parentfdf2c27980f756cf63890576d80eef20b78fe980 (diff)
Misc Fix/Cleaning
- Correct size type ssize_t to test - Remove free() statement because memory don't issued from a malloc causing exception - Remove redundant break statement after a return. Change-Id: I47824dd5cf7afe68cd32e1c3e94e69f31d802995 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--filescan-utils.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/filescan-utils.c b/filescan-utils.c
index a36969b..819efb2 100644
--- a/filescan-utils.c
+++ b/filescan-utils.c
@@ -61,7 +61,7 @@ PUBLIC json_object* ScanForConfig (const char* searchPath, CtlScanDirModeT mode,
if (dirEnt->d_type == DT_REG || dirEnt->d_type == DT_UNKNOWN) {
// check prefix and extention
- size_t extIdx=strlen(dirEnt->d_name)-extLen;
+ ssize_t extIdx=strlen(dirEnt->d_name)-extLen;
if (extIdx <= 0) continue;
if (pre && !strcasestr (dirEnt->d_name, pre)) continue;
if (ext && strcasecmp (ext, &dirEnt->d_name[extIdx])) continue;
@@ -83,7 +83,6 @@ PUBLIC json_object* ScanForConfig (const char* searchPath, CtlScanDirModeT mode,
ScanDir (dirPath);
}
- free (dirList);
return (responseJ);
}
@@ -98,7 +97,6 @@ PUBLIC const char *GetMidleName(const char*name) {
if (fullname[jdx] == '-' || fullname[jdx] == '.' || fullname[jdx] == '\0') {
fullname[jdx] = '\0';
return &fullname[start];
- break;
}
}
break;