about summary refs log tree commit diff
path: root/afl-whatsup
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-09-04 22:48:46 +0200
committerGitHub <noreply@github.com>2020-09-04 22:48:46 +0200
commit4f7a8a4c70de1b93b1dccd8f2bf092ec4b3626dc (patch)
tree8c81a16ba76661b0df5307b9964275ff529d4deb /afl-whatsup
parent7f621509eee57f0b6fd9ad542adc4f2acafeb059 (diff)
parent976ee9022cda95e0715b82ff866098ad293117c9 (diff)
downloadafl++-4f7a8a4c70de1b93b1dccd8f2bf092ec4b3626dc.tar.gz
Merge pull request #542 from AFLplusplus/dev
push to stable
Diffstat (limited to 'afl-whatsup')
-rwxr-xr-xafl-whatsup8
1 files changed, 6 insertions, 2 deletions
diff --git a/afl-whatsup b/afl-whatsup
index abcddbf1..e92b24bd 100755
--- a/afl-whatsup
+++ b/afl-whatsup
@@ -99,7 +99,7 @@ fi
 fmt_duration()
 {
   DUR_STRING=
-  if [ $1 -eq 0 ]; then
+  if [ $1 -le 0 ]; then
     return 1
   fi
 
@@ -109,7 +109,11 @@ fmt_duration()
   local minutes=$(((duration / 60) % 60))
   local seconds=$((duration % 60))
 
-  if [ $days -gt 0 ]; then
+  if [ $duration -le 0 ]; then
+    DUR_STRING="0 seconds"
+  elif [ $duration -eq 1 ]; then
+    DUR_STRING="1 second"
+  elif [ $days -gt 0 ]; then
     DUR_STRING="$days days, $hours hours"
   elif [ $hours -gt 0 ]; then
     DUR_STRING="$hours hours, $minutes minutes"