summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-01-29 11:30:13 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-01-29 11:30:19 (GMT)
commit16fbf6ccb6eefdebc5b43a675f97bd2c294f5297 (patch)
treefa353e2f54cd5af6ba6b7003d75a52d2a80e5468
parent4b2ab96c5120d9effe79dee40f5074d5bf872d55 (diff)
parentae101921e8441d2a87ce0f09804cad2409726cc5 (diff)
downloadCMake-16fbf6ccb6eefdebc5b43a675f97bd2c294f5297.zip
CMake-16fbf6ccb6eefdebc5b43a675f97bd2c294f5297.tar.gz
CMake-16fbf6ccb6eefdebc5b43a675f97bd2c294f5297.tar.bz2
Merge topic 'gcc12-warning'
ae101921e8 Source: Avoid gcc 12 compilation warning Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !6916
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 2700ded..0f8cdca 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -1274,7 +1274,7 @@ std::string cmLocalUnixMakefileGenerator3::CreateMakeVariable(
cmSystemTools::ReplaceString(ret, "-", "__");
cmSystemTools::ReplaceString(ret, "+", "___");
int ni = 0;
- char buffer[5];
+ char buffer[12];
// make sure the _ version is not already used, if
// it is used then add number to the end of the variable
while (this->ShortMakeVariableMap.count(ret) && ni < 1000) {
@@ -1302,7 +1302,7 @@ std::string cmLocalUnixMakefileGenerator3::CreateMakeVariable(
if (static_cast<int>(str1.size()) + static_cast<int>(str2.size()) > size) {
str1 = str1.substr(0, size - str2.size());
}
- char buffer[5];
+ char buffer[12];
int ni = 0;
snprintf(buffer, sizeof(buffer), "%04d", ni);
ret = str1 + str2 + buffer;