🚨 fix a maybe-uninitialized warning

parent 14881cf9
......@@ -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);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment