diff options
| author | 2019-07-16 15:11:21 +0100 | |
|---|---|---|
| committer | 2019-07-16 16:48:18 +0100 | |
| commit | cd8b456f979733525941284639d8bf899173b429 (patch) | |
| tree | f1d26962e61c74c5acb076662a909beafbe8e5fd /src/helperfuncs.cpp | |
| parent | Replace socketengine_{pthread,win32} with C++11 threads. (diff) | |
| parent | ssl_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.cpp | 5 |
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; |
