Fix compile error and warning with gcc

This commit is contained in:
Tatsuhiro Tsujikawa 2015-09-29 23:38:26 +09:00
parent f0d2c9f94b
commit 22a89ff7a6
2 changed files with 4 additions and 1 deletions

View File

@ -303,7 +303,7 @@ int Client::connect() {
return -1; return -1;
} }
} else { } else {
addrinfo *addr; addrinfo *addr = nullptr;
while (next_addr) { while (next_addr) {
addr = next_addr; addr = next_addr;
next_addr = next_addr->ai_next; next_addr = next_addr->ai_next;
@ -317,6 +317,8 @@ int Client::connect() {
return -1; return -1;
} }
assert(addr);
current_addr = addr; current_addr = addr;
} }

View File

@ -27,6 +27,7 @@
#include "nghttp2_config.h" #include "nghttp2_config.h"
#include <cstring>
#include <memory> #include <memory>
#include <array> #include <array>
#include <functional> #include <functional>