fixed print of ip address

This commit is contained in:
wangyu- 2018-08-18 12:55:02 -05:00
parent 44fef508a1
commit 0095f1da5c

View File

@ -280,8 +280,9 @@ char * my_ip_t::get_str1() const
{
assert(inet_ntop(AF_INET6, &v6, res,max_addr_len)!=0);
}
else if(raw_ip_version==AF_INET6)
else
{
assert(raw_ip_version==AF_INET);
assert(inet_ntop(AF_INET, &v4, res,max_addr_len)!=0);
}
return res;
@ -293,8 +294,9 @@ char * my_ip_t::get_str2() const
{
assert(inet_ntop(AF_INET6, &v6, res,max_addr_len)!=0);
}
else if(raw_ip_version==AF_INET)
else
{
assert(raw_ip_version==AF_INET);
assert(inet_ntop(AF_INET, &v4, res,max_addr_len)!=0);
}
return res;