From 0ea61ebe60b1be3b33c400bf1a8ebf9cc6644349 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 26 Sep 2017 18:38:57 +0200 Subject: Better use of strncat Change-Id: I89a1ab96280f7502b0e2f21adc30652b96f82932 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 580c68c..fe76c90 100644 --- a/controller/ctl-config.c +++ b/controller/ctl-config.c @@ -57,8 +57,8 @@ char* CtlConfigSearch(const char *dirList, const char* fileName) { if (strcasestr(filename, controlFile)) { char filepath[CONTROL_MAXPATH_LEN]; strncpy(filepath, fullpath, sizeof (filepath)); - strncat(filepath, "/", sizeof (filepath)); - strncat(filepath, filename, sizeof (filepath)); + strncat(filepath, "/", strlen("/")); + strncat(filepath, filename, strlen(filename)); return (strdup(filepath)); } } -- cgit 1.2.3-korg