diff options
author | Brad King <brad.king@kitware.com> | 2021-10-27 13:23:02 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2021-10-27 13:23:17 (GMT) |
commit | 9bb7982a15e51b0336e58d4cafc20529ec50550d (patch) | |
tree | 5cc5b6744ac6f8da254487002a5a9a7cd832ba80 /Source/cmListCommand.cxx | |
parent | ede11598ba16841c7652160ba8dd755c259bc122 (diff) | |
parent | b7e9cd05cd07605d01a50522f65347aa23d2647e (diff) | |
download | CMake-9bb7982a15e51b0336e58d4cafc20529ec50550d.zip CMake-9bb7982a15e51b0336e58d4cafc20529ec50550d.tar.gz CMake-9bb7982a15e51b0336e58d4cafc20529ec50550d.tar.bz2 |
Merge topic 'purge-sprintf'
b7e9cd05cd Replace the only non-standard _snprintf with snprintf
5ba6e8ac59 Source: Replace most calls to sprintf with snprintf
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !6649
Diffstat (limited to 'Source/cmListCommand.cxx')
-rw-r--r-- | Source/cmListCommand.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmListCommand.cxx b/Source/cmListCommand.cxx index 7d42fc8..b358327 100644 --- a/Source/cmListCommand.cxx +++ b/Source/cmListCommand.cxx @@ -155,7 +155,7 @@ bool HandleLengthCommand(std::vector<std::string> const& args, GetList(varArgsExpanded, listName, status.GetMakefile()); size_t length = varArgsExpanded.size(); char buffer[1024]; - sprintf(buffer, "%d", static_cast<int>(length)); + snprintf(buffer, sizeof(buffer), "%d", static_cast<int>(length)); status.GetMakefile().AddDefinition(variableName, buffer); return true; |