summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-14 19:35:39 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 14:12:02 +0100
commit239f29ae28da7ebf55510fb7fffb47d32fbf52cd (patch)
tree6f3fd5922d9a2e019494ecf26d7bd62a1b12b64b
parent3bbb6b8e4647223d46d5ce436bbca4a526798d17 (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;