Actually only initialize the first value

This commit is contained in:
Robbert van der Helm
2020-03-28 23:09:05 +01:00
parent 220f6f4c43
commit effe584373
+2 -1
View File
@@ -199,7 +199,8 @@ void passthrough_event(boost::asio::local::stream_protocol::socket& socket,
// This buffer is used to write strings and small objects to. We'll
// initialize it with a single null to prevent it from being read as some
// arbitrary C-style string.
std::array<char, max_string_length> string_buffer{0};
std::array<char, max_string_length> string_buffer;
string_buffer[0] = 0;
void* data = std::visit(
overload{
[&](const std::nullptr_t&) -> void* { return nullptr; },