From 0f7cfd46ef2d277f5f82e34a2852c75212d75261 Mon Sep 17 00:00:00 2001 From: Peter Powell Date: Wed, 12 Dec 2018 20:34:46 +0000 Subject: Fix conversion issues by replacing ConvToInt with ConvToNum. The former was a thin wrapper around atol and brought with it all of the weird parsing logic of atol which is almost never what is actually wanted. It also almost never returned the numeric type which is actually wanted which can cause weird issues when casting. --- src/modules/m_kicknorejoin.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/modules/m_kicknorejoin.cpp') diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp index 4d911e78b..70f3578b2 100644 --- a/src/modules/m_kicknorejoin.cpp +++ b/src/modules/m_kicknorejoin.cpp @@ -101,14 +101,14 @@ class KickRejoin : public ParamMode > ModeAction OnSet(User* source, Channel* channel, std::string& parameter) CXX11_OVERRIDE { - int v = ConvToInt(parameter); + unsigned int v = ConvToNum(parameter); if (v <= 0) { source->WriteNumeric(Numerics::InvalidModeParameter(channel, this, parameter)); return MODEACTION_DENY; } - if ((IS_LOCAL(source) && ((unsigned int)v > max))) + if (IS_LOCAL(source) && v > max) v = max; ext.set(channel, new KickRejoinData(v)); -- cgit v1.3.1-10-gc9f91