diff --git a/test/format-test.cc b/test/format-test.cc index 0d0bb906..ac908b8c 100644 --- a/test/format-test.cc +++ b/test/format-test.cc @@ -84,7 +84,7 @@ void std_format(const T &value, std::basic_string &result) { // Workaround a bug in formatting long double in MinGW. void std_format(long double value, std::string &result) { char buffer[100]; - snprintf(buffer, sizeof(buffer), "%Lg", value); + safe_sprintf(buffer, "%Lg", value); result = buffer; } #endif @@ -96,7 +96,7 @@ template std::basic_string actual = (fmt::BasicMemoryWriter() << value).str(); std::basic_string expected; - std_format(value, expected); + std_format(value, expected); if (expected == actual) return ::testing::AssertionSuccess(); return ::testing::AssertionFailure()