mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-25 23:06:10 +01:00
use "std" namespace for "sprintf"
Some compilers don't export C compatibility functions in `::`. Using `std::sprintf` should work for those (and all other compilers). Reference: https://en.cppreference.com/w/cpp/header#C_compatibility_headers
This commit is contained in:
parent
dbbab8727c
commit
711d750ca7
@ -36,7 +36,7 @@ namespace Catch {
|
||||
#ifdef _MSC_VER
|
||||
sprintf_s(buffer, "%.3f", duration);
|
||||
#else
|
||||
sprintf(buffer, "%.3f", duration);
|
||||
std::sprintf(buffer, "%.3f", duration);
|
||||
#endif
|
||||
return std::string(buffer);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user