diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-12-19 20:55:45 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-12-19 20:55:45 +0100 |
commit | 691ddfcb45a6ff32a822372acaac5197be7d7b7c (patch) | |
tree | 7e5f8af39c8854b51f927627ad4b757dd74b3564 /ctl-lib | |
parent | d77db1aa4f4ea93d5fc019ccee0bba90183ffc19 (diff) |
Change prefix generation, simpler is better
Change-Id: Ieb4801b9162f9f8f374b352fb66bed82a8854b7f
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'ctl-lib')
-rw-r--r-- | ctl-lib/ctl-lua.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ctl-lib/ctl-lua.c b/ctl-lib/ctl-lua.c index f487ed4..33b797b 100644 --- a/ctl-lib/ctl-lua.c +++ b/ctl-lib/ctl-lua.c @@ -1281,9 +1281,11 @@ PUBLIC int LuaConfigExec (AFB_ApiT apiHandle, const char* prefix) { // search for default policy config files char fullprefix[CONTROL_MAXPATH_LEN]; - strncpy (fullprefix, prefix, strlen(prefix)+1); - strncat (fullprefix, "-", strlen("-")); - strncat (fullprefix, GetBinderName(), strlen(GetBinderName())); + if(prefix) + strncpy (fullprefix, prefix, strlen(prefix)+1); + else + strncat (fullprefix, GetBinderName(), strlen(GetBinderName())); + strncat (fullprefix, "-", strlen("-")); const char *dirList= getenv("CONTROL_LUA_PATH"); |