From cfa6b14f9c7add4a0ab39074d1c37ae300b7fe29 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 31 Jul 2018 09:09:56 -0400 Subject: cmGlobalGenerator: Avoid -Wstringop-truncation warning Use `memcpy` instead of `strncpy` to copy bytes into a buffer that is not intended to be null terminated. --- Source/cmGlobalGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index c401844..63bbf04 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -2890,7 +2890,7 @@ void cmGlobalGenerator::CheckRuleHashes(std::string const& pfile, std::string fpath = cmSystemTools::CollapseFullPath(fname, home.c_str()); if (cmSystemTools::FileExists(fpath)) { RuleHash hash; - strncpy(hash.Data, line.c_str(), 32); + memcpy(hash.Data, line.c_str(), 32); this->RuleHashes[fname] = hash; } } -- cgit v0.12