From 9df0e1f98ac81ce309026be9098fe8f00ee2a30c Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 31 Jul 2018 09:05:43 -0400 Subject: cmCommandArgumentParserHelper: Avoid -Wstringop-truncation warning Use `memcpy` instead of `strncpy` to copy bytes from a buffer that may not be null terminated. --- Source/cmCommandArgumentParserHelper.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmCommandArgumentParserHelper.cxx b/Source/cmCommandArgumentParserHelper.cxx index ccb4f88..c7210b4 100644 --- a/Source/cmCommandArgumentParserHelper.cxx +++ b/Source/cmCommandArgumentParserHelper.cxx @@ -172,7 +172,7 @@ void cmCommandArgumentParserHelper::AllocateParserType( return; } char* out = new char[len + 1]; - strncpy(out, str, len); + memcpy(out, str, len); out[len] = 0; pt->str = out; this->Variables.push_back(out); -- cgit v0.12