Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Use snprintf instead of sprintf (#2111)

Commit
21c97f2fad9ab9c979b7d1065253bbb4b172b6dc
Author
cat_mint ·
Committer
GitHub
Parents
5b1a6ae00ad6

Files · Download .tar.gz

Changes

 src/catch2/reporters/catch_reporter_combined_tu.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/catch2/reporters/catch_reporter_combined_tu.cpp b/src/catch2/reporters/catch_reporter_combined_tu.cpp
index d6adc60e..d9e94aa9 100644
--- a/src/catch2/reporters/catch_reporter_combined_tu.cpp
+++ b/src/catch2/reporters/catch_reporter_combined_tu.cpp
@@ -44,7 +44,7 @@ namespace Catch {
 #ifdef _MSC_VER
         sprintf_s( buffer, "%.3f", duration );
 #else
-        std::sprintf( buffer, "%.3f", duration );
+        std::snprintf( buffer, maxDoubleSize, "%.3f", duration );
 #endif
         return std::string( buffer );
     }