mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-12 20:39:49 -05:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user