aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_hostchange.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2022-12-18 17:51:35 +0000
committerGravatar Sadie Powell2022-12-18 18:47:28 +0000
commit2ddb62319803f6a3f3246a52b4e009d9ae1daaed (patch)
tree96a5d23c8a38f3282f3e52346cb706d55e58658f /src/modules/m_hostchange.cpp
parentWe actually want ADDRESS_FAMILY not SOCKET_ADDRESS for sa_family_t. (diff)
Use in_port_t instead of int/unsigned int/long.
Diffstat (limited to 'src/modules/m_hostchange.cpp')
-rw-r--r--src/modules/m_hostchange.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/modules/m_hostchange.cpp b/src/modules/m_hostchange.cpp
index fda8e7e67..bd3e2b36b 100644
--- a/src/modules/m_hostchange.cpp
+++ b/src/modules/m_hostchange.cpp
@@ -47,7 +47,7 @@ private:
std::string host;
std::string klass;
std::string mask;
- insp::flat_set<long> ports;
+ insp::flat_set<in_port_t> ports;
std::string prefix;
std::string suffix;
@@ -62,7 +62,10 @@ private:
{
irc::portparser portrange(portlist, false);
while (long port = portrange.GetToken())
- ports.insert(port);
+ {
+ if (port > std::numeric_limits<in_port_t>::min() && port <= std::numeric_limits<in_port_t>::max())
+ ports.insert(static_cast<in_port_t>(port));
+ }
}
}