From 21c97f2fad9ab9c979b7d1065253bbb4b172b6dc Mon Sep 17 00:00:00 2001 From: cat_mint Date: Tue, 1 Dec 2020 09:59:27 -0800 Subject: [PATCH] Use snprintf instead of sprintf (#2111) --- 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 ); }