diff options
author | Peter Powell <petpow@saberuk.com> | 2018-04-16 22:20:29 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2018-04-17 18:36:50 +0100 |
commit | eff72815b561c1241a00405485d26331ff0a0788 (patch) | |
tree | 8775c8d9b37aad5549f64430f30983d9848b8875 /src/modules/m_operlevels.cpp | |
parent | 11a9aaeaa7e979ca4e0a91bc7f001cef2e7138a6 (diff) |
Convert some usages of ato[il] to use ConvToNum.
Diffstat (limited to 'src/modules/m_operlevels.cpp')
-rw-r--r-- | src/modules/m_operlevels.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/modules/m_operlevels.cpp b/src/modules/m_operlevels.cpp index bf758b1f7..2e02ffddf 100644 --- a/src/modules/m_operlevels.cpp +++ b/src/modules/m_operlevels.cpp @@ -35,14 +35,16 @@ class ModuleOperLevels : public Module // oper killing an oper? if (dest->IsOper() && source->IsOper()) { - std::string level = dest->oper->getConfig("level"); - long dest_level = atol(level.c_str()); - level = source->oper->getConfig("level"); - long source_level = atol(level.c_str()); + unsigned long dest_level = ConvToNum<unsigned long>(dest->oper->getConfig("level")); + unsigned long source_level = ConvToNum<unsigned long>(source->oper->getConfig("level")); if (dest_level > source_level) { - if (IS_LOCAL(source)) ServerInstance->SNO->WriteGlobalSno('a', "Oper %s (level %ld) attempted to /kill a higher oper: %s (level %ld): Reason: %s",source->nick.c_str(),source_level,dest->nick.c_str(),dest_level,reason.c_str()); + if (IS_LOCAL(source)) + { + ServerInstance->SNO->WriteGlobalSno('a', "Oper %s (level %lu) attempted to /kill a higher oper: %s (level %lu): Reason: %s", + source->nick.c_str(), source_level, dest->nick.c_str(), dest_level, reason.c_str()); + } dest->WriteNotice("*** Oper " + source->nick + " attempted to /kill you!"); source->WriteNumeric(ERR_NOPRIVILEGES, InspIRCd::Format("Permission Denied - Oper %s is a higher level than you", dest->nick.c_str())); return MOD_RES_DENY; |