mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 21:36:11 +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
|
#ifdef _MSC_VER
|
||||||
sprintf_s(buffer, "%.3f", duration);
|
sprintf_s(buffer, "%.3f", duration);
|
||||||
#else
|
#else
|
||||||
sprintf(buffer, "%.3f", duration);
|
std::sprintf(buffer, "%.3f", duration);
|
||||||
#endif
|
#endif
|
||||||
return std::string(buffer);
|
return std::string(buffer);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user