summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author8000ff <clementmallejac@gmail.com>2018-07-20 16:20:07 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 15:02:55 +0100
commitcb3355770acd0aee636d108264333f784501313b (patch)
tree5426aed349db81217191e7c31c253b130aa573d5
parentad4d3750daa2ec3734ad79a87829a2c529a021a7 (diff)
Fixed character counting that was shortening paths
Change-Id: I16e2f87980229b08426060ec062615d2fa3c1494 Signed-off-by: 8000ff <clementmallejac@gmail.com>
-rw-r--r--ctl-lib/ctl-plugin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ctl-lib/ctl-plugin.c b/ctl-lib/ctl-plugin.c
index bdcdb16..182b34f 100644
--- a/ctl-lib/ctl-plugin.c
+++ b/ctl-lib/ctl-plugin.c
@@ -255,12 +255,12 @@ char *GetDefaultPluginSearchPath(AFB_ApiT apiHandle, const char *prefix)
* between bindingPath and envDirList concatenation.
*/
if(envDirList) {
- envDirList_len = strlen(CONTROL_PLUGIN_PATH) + strlen(envDirList) + bindingPath_len;
+ envDirList_len = strlen(CONTROL_PLUGIN_PATH) + strlen(envDirList) + bindingPath_len + 2;
searchPath = malloc(envDirList_len + 1);
snprintf(searchPath, envDirList_len + 1, "%s:%s:%s", bindingPath, envDirList, CONTROL_PLUGIN_PATH);
}
else {
- envDirList_len = strlen(CONTROL_PLUGIN_PATH) + bindingPath_len;
+ envDirList_len = strlen(CONTROL_PLUGIN_PATH) + bindingPath_len + 1;
searchPath = malloc(envDirList_len + 1);
snprintf(searchPath, envDirList_len + 1, "%s:%s", bindingPath, CONTROL_PLUGIN_PATH);
}