aboutsummaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/treesocket2.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2025-03-01 16:06:32 +0000
committerGravatar Sadie Powell2025-03-01 16:06:32 +0000
commit32a127d2e0c0a624d12cf9570905fec264554550 (patch)
treecdb0a259159753d4479ae36799256d1d807779d0 /src/modules/m_spanningtree/treesocket2.cpp
parentRelease v4.6.0. (diff)
Avoid the use of ConvToStr in string concatenation.
This function calls INSP_FORMAT in most cases nowadays so we may as well just call that manually.
Diffstat (limited to 'src/modules/m_spanningtree/treesocket2.cpp')
-rw-r--r--src/modules/m_spanningtree/treesocket2.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/modules/m_spanningtree/treesocket2.cpp b/src/modules/m_spanningtree/treesocket2.cpp
index eae8cbe21..3d454eef9 100644
--- a/src/modules/m_spanningtree/treesocket2.cpp
+++ b/src/modules/m_spanningtree/treesocket2.cpp
@@ -161,11 +161,11 @@ void TreeSocket::ProcessLine(std::string& line)
if (!params.empty())
{
time_t them = ServerCommand::ExtractTS(params[0]);
- time_t delta = them - ServerInstance->Time();
- if ((delta < -15) || (delta > 15))
+ time_t delta = std::abs(them - ServerInstance->Time());
+ if (delta > 15)
{
- ServerInstance->SNO.WriteGlobalSno('l', "\002ERROR\002: Your clocks are off by {} seconds (this is more than fifteen seconds). Link aborted, \002PLEASE SYNC YOUR CLOCKS!\002", labs((long)delta));
- SendError("Your clocks are out by "+ConvToStr(labs((long)delta))+" seconds (this is more than fifteen seconds). Link aborted, PLEASE SYNC YOUR CLOCKS!");
+ ServerInstance->SNO.WriteGlobalSno('l', "\002ERROR\002: Your clocks are off by {} seconds (this is more than fifteen seconds). Link aborted, \002PLEASE SYNC YOUR CLOCKS!\002", delta);
+ SendError(INSP_FORMAT("Your clocks are out by {} seconds (this is more than fifteen seconds). Link aborted, PLEASE SYNC YOUR CLOCKS!", delta));
return;
}
else if ((delta < -5) || (delta > 5))