summaryrefslogtreecommitdiff
path: root/modules/proxyscan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/proxyscan.cpp')
-rw-r--r--modules/proxyscan.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/modules/proxyscan.cpp b/modules/proxyscan.cpp
index 42beb37e5..e7c761c9f 100644
--- a/modules/proxyscan.cpp
+++ b/modules/proxyscan.cpp
@@ -88,7 +88,7 @@ protected:
reason = reason.replace_all_cs("%t", this->GetType());
reason = reason.replace_all_cs("%i", this->conaddr.addr());
- reason = reason.replace_all_cs("%p", stringify(this->conaddr.port()));
+ reason = reason.replace_all_cs("%p", Anope::ToString(this->conaddr.port()));
BotInfo *OperServ = Config->GetClient("OperServ");
Log(OperServ) << "PROXYSCAN: Open " << this->GetType() << " proxy found on " << this->conaddr.str() << " (" << reason << ")";
@@ -321,12 +321,8 @@ public:
commasepstream sep2(block->Get<const Anope::string>("port"));
while (sep2.GetToken(token))
{
- try
- {
- unsigned short port = convertTo<unsigned short>(token);
- p.ports.push_back(port);
- }
- catch (const ConvertException &) { }
+ if (auto port = Anope::TryConvert<unsigned short>(token))
+ p.ports.push_back(port.value());
}
if (p.ports.empty())
continue;