From 712313ae7cdf2ab81d497dc810a20eee8211c8e9 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Tue, 14 Aug 2018 18:59:07 +0100 Subject: Fix some bugs in cidr_mask::str(). - Fix a missing break statement causing unintentional fallthrough. - Cast the length to an int to avoid interpreting as a character. --- src/socket.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/socket.cpp b/src/socket.cpp index 5827b8b77..cdbc83e44 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -377,6 +377,7 @@ std::string irc::sockets::cidr_mask::str() const case AF_INET6: base = (unsigned char*)&sa.in6.sin6_addr; len = 16; + break; case AF_UNIX: return sa.un.sun_path; @@ -388,7 +389,7 @@ std::string irc::sockets::cidr_mask::str() const } memcpy(base, bits, len); - return sa.addr() + "/" + ConvToStr(length); + return sa.addr() + "/" + ConvToStr((int)length); } bool irc::sockets::cidr_mask::operator==(const cidr_mask& other) const -- cgit v1.2.3