network: initialize ip_addr in GetHostIPv4Address()

master
Sönke Holz 2021-08-13 00:28:44 +07:00
parent acca8aca8c
commit 765e97c347
1 changed files with 1 additions and 1 deletions

@ -372,7 +372,7 @@ std::optional<IPv4Address> GetHostIPv4Address() {
}); });
if (res != network_interfaces.end()) { if (res != network_interfaces.end()) {
char ip_addr[16]; char ip_addr[16] = {};
ASSERT(inet_ntop(AF_INET, &res->ip_address, ip_addr, sizeof(ip_addr)) != nullptr); ASSERT(inet_ntop(AF_INET, &res->ip_address, ip_addr, sizeof(ip_addr)) != nullptr);
LOG_INFO(Network, "IP address: {}", ip_addr); LOG_INFO(Network, "IP address: {}", ip_addr);