From 767ddbdec7e91e2cf4a1edcdd4afe74519986e44 Mon Sep 17 00:00:00 2001 From: Gunnar Beutner Date: Wed, 4 Mar 2015 16:41:53 +0100 Subject: [PATCH] Fix compiler warning in Process::Run --- lib/base/process.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/base/process.cpp b/lib/base/process.cpp index 44f751f46..b8eb93b86 100644 --- a/lib/base/process.cpp +++ b/lib/base/process.cpp @@ -546,8 +546,8 @@ void Process::Run(const boost::function& callback) if (icinga2_execvpe(argv[0], argv, envp) < 0) { char errmsg[512]; strcpy(errmsg, "execvpe("); - strncat(errmsg, argv[0], sizeof(errmsg) - 1); - strncat(errmsg, ") failed", sizeof(errmsg) - 1); + strncat(errmsg, argv[0], sizeof(errmsg) - strlen(errmsg) - 1); + strncat(errmsg, ") failed", sizeof(errmsg) - strlen(errmsg) - 1); errmsg[sizeof(errmsg) - 1] = '\0'; perror(errmsg); _exit(128);