diff options
author | Brad King <brad.king@kitware.com> | 2018-07-31 13:09:56 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-07-31 13:34:55 (GMT) |
commit | cfa6b14f9c7add4a0ab39074d1c37ae300b7fe29 (patch) | |
tree | 309e90017546a1cd994f3528ba7e469debb71d28 /Source/cmGlobalGenerator.cxx | |
parent | 9df0e1f98ac81ce309026be9098fe8f00ee2a30c (diff) | |
download | CMake-cfa6b14f9c7add4a0ab39074d1c37ae300b7fe29.zip CMake-cfa6b14f9c7add4a0ab39074d1c37ae300b7fe29.tar.gz CMake-cfa6b14f9c7add4a0ab39074d1c37ae300b7fe29.tar.bz2 |
cmGlobalGenerator: Avoid -Wstringop-truncation warning
Use `memcpy` instead of `strncpy` to copy bytes into a buffer that
is not intended to be null terminated.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r-- | Source/cmGlobalGenerator.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
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; } } |