summaryrefslogtreecommitdiff
path: root/src/socket.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-08-14 18:59:07 +0100
committerPeter Powell <petpow@saberuk.com>2018-08-14 18:59:07 +0100
commit712313ae7cdf2ab81d497dc810a20eee8211c8e9 (patch)
tree4fb8a0c474a4c8f2a04db535ab435f6319af4acf /src/socket.cpp
parent188acfed6f9e051e6e3ea5e4c5ac1cce4a96c529 (diff)
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.
Diffstat (limited to 'src/socket.cpp')
-rw-r--r--src/socket.cpp3
1 files changed, 2 insertions, 1 deletions
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