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_spanningtree/addline.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_spanningtree/addline.cpp')
| -rw-r--r-- | src/modules/m_spanningtree/addline.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/modules/m_spanningtree/addline.cpp b/src/modules/m_spanningtree/addline.cpp index 00ef5b8d1..623942d95 100644 --- a/src/modules/m_spanningtree/addline.cpp +++ b/src/modules/m_spanningtree/addline.cpp @@ -38,14 +38,14 @@ CmdResult CommandAddLine::Handle(User* usr, Params& params) XLine* xl = NULL; try { - xl = xlf->Generate(ServerInstance->Time(), ConvToInt(params[4]), params[2], params[5], params[1]); + xl = xlf->Generate(ServerInstance->Time(), ConvToNum<long>(params[4]), params[2], params[5], params[1]); } catch (ModuleException &e) { ServerInstance->SNO->WriteToSnoMask('x',"Unable to ADDLINE type %s from %s: %s", params[0].c_str(), setter.c_str(), e.GetReason().c_str()); return CMD_FAILURE; } - xl->SetCreateTime(ConvToInt(params[3])); + xl->SetCreateTime(ConvToNum<time_t>(params[3])); if (ServerInstance->XLines->AddLine(xl, NULL)) { if (xl->duration) |
