add zero seconds handling

GSoC/Meterpreter_Web_Console
Kent 'picat' Gruber 2018-06-08 22:21:26 -04:00
parent 679a225462
commit 2bdc8803cb
1 changed files with 1 additions and 0 deletions

View File

@ -11,6 +11,7 @@ module Rex
# minutes, and second.
#
def self.sec_to_s(seconds)
return "0 secs" if seconds.to_i <= 0
[[31536000, 'year'], [86400, 'day'], [3600, 'hour'], [60, 'min'], [1, 'sec']].map! { |count, name|
if (c = seconds / count) > 0
c = c.truncate