Unverified Commit 5b3765f0 authored by Igor [hyperxor]'s avatar Igor [hyperxor] Committed by GitHub

Set addrinfo to zero and clang format for net.cc (#723)

parent 41b8022f
......@@ -299,7 +299,8 @@ void Address::init(const std::string &addr) {
if (hp) {
char **addr = hp->h_addr_list;
while (*addr) {
host_ = std::string(inet_ntoa(*reinterpret_cast<struct in_addr *>(*addr)));
host_ =
std::string(inet_ntoa(*reinterpret_cast<struct in_addr *>(*addr)));
break;
}
}
......
......@@ -133,6 +133,7 @@ void Listener::bind(const Address &address) {
addr_ = address;
struct addrinfo hints;
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = address.family();
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_PASSIVE;
......
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