diff options
| author | 2018-12-12 20:34:46 +0000 | |
|---|---|---|
| committer | 2018-12-12 21:43:24 +0000 | |
| commit | 0f7cfd46ef2d277f5f82e34a2852c75212d75261 (patch) | |
| tree | 73445b54ad2ce50ae75999ec9f939ff1097b057a /src/modules/m_messageflood.cpp | |
| parent | Fix not rejecting invalid durations in DCCALLOW. (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_messageflood.cpp')
| -rw-r--r-- | src/modules/m_messageflood.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 0707e6ae4..af976afd5 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -83,8 +83,8 @@ class MsgFlood : public ParamMode<MsgFlood, SimpleExtItem<floodsettings> > /* Set up the flood parameters for this channel */ bool ban = (parameter[0] == '*'); - unsigned int nlines = ConvToInt(parameter.substr(ban ? 1 : 0, ban ? colon-1 : colon)); - unsigned int nsecs = ConvToInt(parameter.substr(colon+1)); + unsigned int nlines = ConvToNum<unsigned int>(parameter.substr(ban ? 1 : 0, ban ? colon-1 : colon)); + unsigned int nsecs = ConvToNum<unsigned int>(parameter.substr(colon+1)); if ((nlines<2) || (nsecs<1)) { |
