diff options
Diffstat (limited to 'Source/cmStringCommand.cxx')
-rw-r--r-- | Source/cmStringCommand.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index c3ee695..fe311d1 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; } |