Commit 29131437 authored by Dainius Narsutis's avatar Dainius Narsutis

Merge branch 'ip_init_bug'

parents 88d8c865 0c875a95
...@@ -231,7 +231,7 @@ Address::init(const std::string& addr) { ...@@ -231,7 +231,7 @@ Address::init(const std::string& addr) {
try { try {
in_addr addr; in_addr addr;
char buff[INET_ADDRSTRLEN+1]; char buff[INET_ADDRSTRLEN+1];
memcpy(buff, host_.c_str(), INET6_ADDRSTRLEN); memcpy(buff, host_.c_str(), INET_ADDRSTRLEN);
inet_pton(AF_INET, buff, &(addr)); inet_pton(AF_INET, buff, &(addr));
} catch (std::runtime_error) { } catch (std::runtime_error) {
throw std::invalid_argument("Invalid IPv4 address"); throw std::invalid_argument("Invalid IPv4 address");
......
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