From 6ee4db6878464642ddf9f0909748841a45b58a88 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Thu, 2 Nov 2017 15:58:45 +0100 Subject: Migrate to ctl-utilities library New version of controller as a library. Loading additionnals files from each sections. Change-Id: I4f5e78d0baf9650cb8d1cc1da26f8e1fd73b792c Signed-off-by: Romain Forlot --- controller/ctl-plugin.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'controller/ctl-plugin.c') diff --git a/controller/ctl-plugin.c b/controller/ctl-plugin.c index 9a34a29..62fdb8b 100644 --- a/controller/ctl-plugin.c +++ b/controller/ctl-plugin.c @@ -18,7 +18,7 @@ * Json load using json_unpack https://jansson.readthedocs.io/en/2.9/apiref.html#parsing-and-validating-values */ - #define _GNU_SOURCE +#define _GNU_SOURCE #include #include #include @@ -126,9 +126,9 @@ STATIC int PluginLoadOne (CtlPluginT *ctlPlugin, json_object *pluginJ, void* han } char pluginpath[CONTROL_MAXPATH_LEN]; - strncpy(pluginpath, fullpath, sizeof (pluginpath)); - strncat(pluginpath, "/", sizeof (pluginpath)); - strncat(pluginpath, filename, sizeof (pluginpath)); + strncpy(pluginpath, fullpath, strlen(fullpath)); + strncat(pluginpath, "/", strlen("/")); + strncat(pluginpath, filename, strlen(filename)); dlHandle = dlopen(pluginpath, RTLD_NOW); if (!dlHandle) { AFB_ERROR("CTL-PLUGIN-LOADONE Fail to load pluginpath=%s err= %s", pluginpath, dlerror()); -- cgit 1.2.3-korg