diff options
author | Sean McBride <sean@rogue-research.com> | 2021-10-21 16:35:57 (GMT) |
---|---|---|
committer | Sean McBride <sean@rogue-research.com> | 2021-10-25 22:23:13 (GMT) |
commit | 5ba6e8ac59333aa574d5963332e3ef0f4c4d3514 (patch) | |
tree | d796f695e10d5ec20508cb04f4c8b3c2a6c0d742 /Source/CTest/cmCTestCoverageHandler.cxx | |
parent | 0ce50dd78f68b697e1ab29d52d733b87c5bfb67d (diff) | |
download | CMake-5ba6e8ac59333aa574d5963332e3ef0f4c4d3514.zip CMake-5ba6e8ac59333aa574d5963332e3ef0f4c4d3514.tar.gz CMake-5ba6e8ac59333aa574d5963332e3ef0f4c4d3514.tar.bz2 |
Source: Replace most calls to sprintf with snprintf
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 57b1dda..c38a0ac 100644 --- a/Source/CTest/cmCTestCoverageHandler.cxx +++ b/Source/CTest/cmCTestCoverageHandler.cxx @@ -148,7 +148,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); @@ -165,7 +166,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); |