aboutsummaryrefslogtreecommitdiffstats
path: root/controller/ctl-plugin.c
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-26 18:38:57 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commit0ea61ebe60b1be3b33c400bf1a8ebf9cc6644349 (patch)
tree48645f3073c2bdc2a18de2a1d2c9ff4123302ea6 /controller/ctl-plugin.c
parent6b492d666ed1faeeec5f761105f473956b426cc9 (diff)
Better use of strncat
Change-Id: I89a1ab96280f7502b0e2f21adc30652b96f82932 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'controller/ctl-plugin.c')
-rw-r--r--controller/ctl-plugin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/controller/ctl-plugin.c b/controller/ctl-plugin.c
index 9e4e419..6c73573 100644
--- a/controller/ctl-plugin.c
+++ b/controller/ctl-plugin.c
@@ -159,10 +159,10 @@ STATIC int PluginLoadOne (CtlPluginT *ctlPlugin, json_object *pluginJ, void* han
int Lua2cAddOne(luaL_Reg *l2cFunc, const char* l2cName, int index) {
char funcName[CONTROL_MAXPATH_LEN];
strncpy(funcName, "lua2c_", sizeof (funcName));
- strncat(funcName, l2cName, sizeof (funcName));
+ strncat(funcName, l2cName, strlen(l2cName));
Lua2cFunctionT l2cFunction = (Lua2cFunctionT) dlsym(dlHandle, funcName);
- if (!l2cFunction) {
+ if (!l2cFunction) {
AFB_ERROR("CTL-PLUGIN-LOADONE symbol'%s' missing err=%s", funcName, dlerror());
return 1;
}