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/CTest/cmCTestCoverageHandler.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/CTest/cmCTestCoverageHandler.cxx')
-rw-r--r-- | Source/CTest/cmCTestCoverageHandler.cxx | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/CTest/cmCTestCoverageHandler.cxx b/Source/CTest/cmCTestCoverageHandler.cxx index b16d4d0..4c738c3 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -147,7 +147,8 @@ bool cmCTestCoverageHandler::StartCoverageLogFile( cmGeneratedFileStream& covLogFile, int logFileCount) { char covLogFilename[1024]; - sprintf(covLogFilename, "CoverageLog-%d", logFileCount); + snprintf(covLogFilename, sizeof(covLogFilename), "CoverageLog-%d", + logFileCount); cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Open file: " << covLogFilename << std::endl, this->Quiet); @@ -164,7 +165,8 @@ void cmCTestCoverageHandler::EndCoverageLogFile(cmGeneratedFileStream& ostr, int logFileCount) { char covLogFilename[1024]; - sprintf(covLogFilename, "CoverageLog-%d.xml", logFileCount); + snprintf(covLogFilename, sizeof(covLogFilename), "CoverageLog-%d.xml", + logFileCount); cmCTestOptionalLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Close file: " << covLogFilename << std::endl, this->Quiet); |