🚨 fix a maybe-uninitialized warning
This commit is contained in:
parent
14881cf901
commit
262d9cc67d
1 changed files with 6 additions and 6 deletions
|
@ -359,9 +359,9 @@ TEST_CASE("formatting")
|
|||
{
|
||||
auto check_float = [](float number, const std::string & expected)
|
||||
{
|
||||
char buf[33];
|
||||
char* end = nlohmann::detail::to_chars(buf, buf + 32, number);
|
||||
std::string actual(buf, end);
|
||||
std::array<char, 33> buf{};
|
||||
char* end = nlohmann::detail::to_chars(buf.data(), buf.data() + 32, number);
|
||||
std::string actual(buf.data(), end);
|
||||
|
||||
CHECK(actual == expected);
|
||||
};
|
||||
|
@ -419,9 +419,9 @@ TEST_CASE("formatting")
|
|||
{
|
||||
auto check_double = [](double number, const std::string & expected)
|
||||
{
|
||||
char buf[33];
|
||||
char* end = nlohmann::detail::to_chars(buf, buf + 32, number);
|
||||
std::string actual(buf, end);
|
||||
std::array<char, 33> buf{};
|
||||
char* end = nlohmann::detail::to_chars(buf.data(), buf.data() + 32, number);
|
||||
std::string actual(buf.data(), end);
|
||||
|
||||
CHECK(actual == expected);
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue