From 0095f1da5c55c36a876ee64fcf06bf57102a49a1 Mon Sep 17 00:00:00 2001 From: wangyu- Date: Sat, 18 Aug 2018 12:55:02 -0500 Subject: [PATCH] fixed print of ip address --- common.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common.cpp b/common.cpp index 1a50414..3d7f85b 100644 --- a/common.cpp +++ b/common.cpp @@ -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;