aboutsummaryrefslogtreecommitdiffstats
path: root/src/helperfuncs.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2019-07-16 15:11:21 +0100
committerGravatar Sadie Powell2019-07-16 16:48:18 +0100
commitcd8b456f979733525941284639d8bf899173b429 (patch)
treef1d26962e61c74c5acb076662a909beafbe8e5fd /src/helperfuncs.cpp
parentReplace socketengine_{pthread,win32} with C++11 threads. (diff)
parentssl_gnutls: remove PackageInfo directives for EOL Debian versions. (diff)
Merge branch 'insp3' into master.
Diffstat (limited to 'src/helperfuncs.cpp')
-rw-r--r--src/helperfuncs.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp
index 6a09e6357..5d5998d3f 100644
--- a/src/helperfuncs.cpp
+++ b/src/helperfuncs.cpp
@@ -432,7 +432,10 @@ bool InspIRCd::IsValidDuration(const std::string& duration)
std::string InspIRCd::DurationString(time_t duration)
{
- time_t years = duration / 31536000;
+ if (duration == 0)
+ return "0s";
+
+ time_t years = duration / 31449600;
time_t weeks = (duration / 604800) % 52;
time_t days = (duration / 86400) % 7;
time_t hours = (duration / 3600) % 24;