summaryrefslogtreecommitdiffstats
path: root/Source/cmStringCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmStringCommand.cxx')
-rw-r--r--Source/cmStringCommand.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx
index c3ee695..c12d1fe 100644
--- a/Source/cmStringCommand.cxx
+++ b/Source/cmStringCommand.cxx
@@ -143,7 +143,8 @@ bool HandleHexCommand(std::vector<std::string> const& args,
std::string::size_type hexIndex = 0;
for (auto const& c : instr) {
- sprintf(&output[hexIndex], "%.2x", static_cast<unsigned char>(c) & 0xFF);
+ snprintf(&output[hexIndex], 3, "%.2x",
+ static_cast<unsigned char>(c) & 0xFF);
hexIndex += 2;
}
@@ -1013,7 +1014,7 @@ int ParseIndex(
Json::ArrayIndex index = static_cast<Json::ArrayIndex>(lindex);
if (index >= max) {
cmAlphaNum sizeStr{ max };
- throw json_error({ "expected an index less then "_s, sizeStr.View(),
+ throw json_error({ "expected an index less than "_s, sizeStr.View(),
" got '"_s, str, "'"_s },
progress);
}