summaryrefslogtreecommitdiffstats
path: root/ctl-lib
diff options
context:
space:
mode:
Diffstat (limited to 'ctl-lib')
-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 0a14e20..6839a01 100644
--- a/ctl-lib/ctl-plugin.c
+++ b/ctl-lib/ctl-plugin.c
@@ -125,8 +125,8 @@ static int PluginLoadCOne(afb_api_t apiHandle, const char *pluginpath, json_obje
size_t p_length = 6 + strlen(l2cName);
funcName = malloc(p_length + 1);
- strncpy(funcName, "lua2c_", p_length);
- strncat(funcName, l2cName, sizeof(funcName) - strlen (funcName) + 1);
+ strncpy(funcName, "lua2c_", p_length + 1);
+ strncat(funcName, l2cName, p_length - strlen (funcName) + 1);
Lua2cFunctionT l2cFunction = (Lua2cFunctionT) dlsym(dlHandle, funcName);
if (!l2cFunction) {