From 5f9c2b3c97ed1eeb19270fd3582b71ca8e1ca1ac Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Fri, 10 Jul 2026 11:15:52 +0100 Subject: Use saturating adds/subtracts when handling timestamps. --- modules/log_sql.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/log_sql.cpp') diff --git a/modules/log_sql.cpp b/modules/log_sql.cpp index 4bfed1355..13fa3f63c 100644 --- a/modules/log_sql.cpp +++ b/modules/log_sql.cpp @@ -19,6 +19,7 @@ #include "inspircd.h" #include "modules/sql.h" +#include "timeutils.h" namespace { @@ -65,7 +66,7 @@ public: if (!sql) { // Only give a warning every 5 minutes to avoid log spam. - if (ServerInstance->Time() - lastwarning > 300) + if (Time::Ago(lastwarning) > 300) { lastwarning = ServerInstance->Time(); ServerInstance->SNO.WriteGlobalSno('a', "Unable to write to SQL log (database {} not available).", sql->GetId()); -- cgit v1.3.1-10-gc9f91