X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fhelperfuncs.cpp;h=70ac2f0e6a9e7c281d23acbbf33b493d9452f3a1;hb=b64177d3fb4f113c4db3325575970964867f01cc;hp=846feab5072fd21e7c6ad63b0da9f7ed5b56fa94;hpb=e02c22ff165c7b0dbe39343066a4167e94f5618e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/helperfuncs.cpp b/src/helperfuncs.cpp index 846feab50..70ac2f0e6 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;