summaryrefslogtreecommitdiff
path: root/src/modules/m_nickflood.cpp
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2018-12-12 20:34:46 +0000
committerPeter Powell <petpow@saberuk.com>2018-12-12 21:43:24 +0000
commit0f7cfd46ef2d277f5f82e34a2852c75212d75261 (patch)
tree73445b54ad2ce50ae75999ec9f939ff1097b057a /src/modules/m_nickflood.cpp
parent4e0cb28c1913c4ef76dd06b04fe321afe310f232 (diff)
Fix conversion issues by replacing ConvToInt with ConvToNum<T>.
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.
Diffstat (limited to 'src/modules/m_nickflood.cpp')
-rw-r--r--src/modules/m_nickflood.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp
index 50e2b3d93..ce8b364e4 100644
--- a/src/modules/m_nickflood.cpp
+++ b/src/modules/m_nickflood.cpp
@@ -100,8 +100,8 @@ class NickFlood : public ParamMode<NickFlood, SimpleExtItem<nickfloodsettings> >
}
/* Set up the flood parameters for this channel */
- unsigned int nnicks = ConvToInt(parameter.substr(0, colon));
- unsigned int nsecs = ConvToInt(parameter.substr(colon+1));
+ unsigned int nnicks = ConvToNum<unsigned int>(parameter.substr(0, colon));
+ unsigned int nsecs = ConvToNum<unsigned int>(parameter.substr(colon+1));
if ((nnicks<1) || (nsecs<1))
{