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_delaymsg.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_delaymsg.cpp')
| -rw-r--r-- | src/modules/m_delaymsg.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/m_delaymsg.cpp b/src/modules/m_delaymsg.cpp index b39fb1d0a..9015e7bf9 100644 --- a/src/modules/m_delaymsg.cpp +++ b/src/modules/m_delaymsg.cpp @@ -38,7 +38,7 @@ class DelayMsgMode : public ParamMode<DelayMsgMode, LocalIntExt> ModeAction OnSet(User* source, Channel* chan, std::string& parameter) CXX11_OVERRIDE; void OnUnset(User* source, Channel* chan); - void SerializeParam(Channel* chan, int n, std::string& out) + void SerializeParam(Channel* chan, intptr_t n, std::string& out) { out += ConvToStr(n); } @@ -62,8 +62,8 @@ class ModuleDelayMsg : public Module ModeAction DelayMsgMode::OnSet(User* source, Channel* chan, std::string& parameter) { // Setting a new limit, sanity check - unsigned int limit = ConvToInt(parameter); - if (limit == 0) + intptr_t limit = ConvToNum<intptr_t>(parameter); + if (limit <= 0) limit = 1; ext.set(chan, limit); |
