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_repeat.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_repeat.cpp')
| -rw-r--r-- | src/modules/m_repeat.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/modules/m_repeat.cpp b/src/modules/m_repeat.cpp index ef62e9ab1..af69f6be1 100644 --- a/src/modules/m_repeat.cpp +++ b/src/modules/m_repeat.cpp @@ -274,7 +274,7 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> > else settings.Action = ChannelSettings::ACT_KICK; - if ((settings.Lines = ConvToInt(item)) == 0) + if ((settings.Lines = ConvToNum<unsigned int>(item)) == 0) return false; if ((!stream.GetToken(item)) || ((settings.Seconds = InspIRCd::Duration(item)) == 0)) @@ -286,13 +286,13 @@ class RepeatMode : public ParamMode<RepeatMode, SimpleExtItem<ChannelSettings> > if (stream.GetToken(item)) { // There is a diff parameter, see if it's valid (> 0) - if ((settings.Diff = ConvToInt(item)) == 0) + if ((settings.Diff = ConvToNum<unsigned int>(item)) == 0) return false; if (stream.GetToken(item)) { // There is a backlog parameter, see if it's valid - if ((settings.Backlog = ConvToInt(item)) == 0) + if ((settings.Backlog = ConvToNum<unsigned int>(item)) == 0) return false; // If there are still tokens, then it's invalid because we allow only 4 |
