summaryrefslogtreecommitdiff
path: root/extras.c
diff options
context:
space:
mode:
Diffstat (limited to 'extras.c')
-rw-r--r--extras.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/extras.c b/extras.c
index bde4172..fa78c86 100644
--- a/extras.c
+++ b/extras.c
@@ -510,6 +510,13 @@ char * i3lock_format_elapsed_time(char *to,
510 510
511 char tmp_str[max_size]; 511 char tmp_str[max_size];
512 char int_str[32]; /* more than enough for int */ 512 char int_str[32]; /* more than enough for int */
513
514 if (seconds < 0) {
515 if (!(seconds % 3))
516 return NULL;
517 seconds = 0;
518 }
519
513 int days = seconds / 86400; 520 int days = seconds / 86400;
514 int hours = (seconds - days * 86400) / 3600; 521 int hours = (seconds - days * 86400) / 3600;
515 int minutes = (seconds - days * 86400 - hours * 3600) / 60; 522 int minutes = (seconds - days * 86400 - hours * 3600) / 60;