diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2022-11-16 14:57:43 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2022-11-18 14:37:58 (GMT) |
commit | 830eed374d540ebd643cd9385546838804c07160 (patch) | |
tree | 3c71403a089cfa791665d381a80f21902dfa11bd /Source/cmExportFileGenerator.cxx | |
parent | c6368a23feae261bfce4beaf0b4fca4c5c56677e (diff) | |
download | CMake-830eed374d540ebd643cd9385546838804c07160.zip CMake-830eed374d540ebd643cd9385546838804c07160.tar.gz CMake-830eed374d540ebd643cd9385546838804c07160.tar.bz2 |
CMake: fix sizeof string literal violations
Diffstat (limited to 'Source/cmExportFileGenerator.cxx')
-rw-r--r-- | Source/cmExportFileGenerator.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index bd2b6af..c8e2cb8 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -669,8 +669,7 @@ void cmExportFileGenerator::ResolveTargetsInGeneratorExpression( while ((pos = input.find("$<TARGET_PROPERTY:", lastPos)) != std::string::npos) { - std::string::size_type nameStartPos = - pos + sizeof("$<TARGET_PROPERTY:") - 1; + std::string::size_type nameStartPos = pos + cmStrLen("$<TARGET_PROPERTY:"); std::string::size_type closePos = input.find('>', nameStartPos); std::string::size_type commaPos = input.find(',', nameStartPos); std::string::size_type nextOpenPos = input.find("$<", nameStartPos); @@ -696,7 +695,7 @@ void cmExportFileGenerator::ResolveTargetsInGeneratorExpression( pos = 0; lastPos = pos; while ((pos = input.find("$<TARGET_NAME:", lastPos)) != std::string::npos) { - std::string::size_type nameStartPos = pos + sizeof("$<TARGET_NAME:") - 1; + std::string::size_type nameStartPos = pos + cmStrLen("$<TARGET_NAME:"); std::string::size_type endPos = input.find('>', nameStartPos); if (endPos == std::string::npos) { errorString = "$<TARGET_NAME:...> expression incomplete"; @@ -721,7 +720,7 @@ void cmExportFileGenerator::ResolveTargetsInGeneratorExpression( lastPos = pos; while (errorString.empty() && (pos = input.find("$<LINK_ONLY:", lastPos)) != std::string::npos) { - std::string::size_type nameStartPos = pos + sizeof("$<LINK_ONLY:") - 1; + std::string::size_type nameStartPos = pos + cmStrLen("$<LINK_ONLY:"); std::string::size_type endPos = input.find('>', nameStartPos); if (endPos == std::string::npos) { errorString = "$<LINK_ONLY:...> expression incomplete"; |