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-config.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'controller/ctl-config.c') diff --git a/controller/ctl-config.c b/controller/ctl-config.c index fe76c90..cf24057 100644 --- a/controller/ctl-config.c +++ b/controller/ctl-config.c @@ -35,7 +35,7 @@ char* CtlConfigSearch(const char *dirList, const char* fileName) { strncpy(controlFile, fileName, CONTROL_MAXPATH_LEN); } else { strncpy(controlFile, CONTROL_CONFIG_PRE "-", CONTROL_MAXPATH_LEN); - strncat(controlFile, GetBinderName(), CONTROL_MAXPATH_LEN); + strncat(controlFile, GetBinderName(), strlen(GetBinderName())); // Only possible because returned GetBinderName value is a static variable. } // search for default dispatch config file @@ -56,7 +56,7 @@ char* CtlConfigSearch(const char *dirList, const char* fileName) { if (index == 0) { if (strcasestr(filename, controlFile)) { char filepath[CONTROL_MAXPATH_LEN]; - strncpy(filepath, fullpath, sizeof (filepath)); + strncpy(filepath, fullpath, strlen(fullpath)); strncat(filepath, "/", strlen("/")); strncat(filepath, filename, strlen(filename)); return (strdup(filepath)); -- cgit 1.2.3-korg