cmGlobalGenerator: Avoid -Wstringop-truncation warning

Use `memcpy` instead of `strncpy` to copy bytes into a buffer that
is not intended to be null terminated.
This commit is contained in:
Brad King
2018-07-31 09:09:56 -04:00
parent 9df0e1f98a
commit cfa6b14f9c

View File

@@ -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;
}
}