Commit 18fd919d authored by hydratim's avatar hydratim

Fixed compiler warning

parent 96d33210
...@@ -361,10 +361,12 @@ Host::parse(const std::string& data) { ...@@ -361,10 +361,12 @@ Host::parse(const std::string& data) {
char *end; char *end;
const std::string portPart = data.substr(pos + 1); const std::string portPart = data.substr(pos + 1);
long port; long port;
if (portPart.empty()) if (portPart.empty()) {
port = HTTP_STANDARD_PORT; port = HTTP_STANDARD_PORT;
else }
else {
port = strtol(portPart.c_str(), &end, 10); port = strtol(portPart.c_str(), &end, 10);
}
if (*end != 0 || port < Port::min() || port > Port::max()) if (*end != 0 || port < Port::min() || port > Port::max())
throw std::invalid_argument("Invalid port"); throw std::invalid_argument("Invalid port");
port_ = static_cast<uint16_t>(port); port_ = static_cast<uint16_t>(port);
......
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