From 93513c90ab62c124b8800722cce7af041fcc0707 Mon Sep 17 00:00:00 2001 From: dam Date: Sun, 25 Sep 2022 23:00:07 +0000 Subject: Adjusted format_time when showing less than 60 seconds. --- main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index cce6154..b1c44af 100644 --- a/main.c +++ b/main.c @@ -1,6 +1,6 @@ // Compilation command: -// - release: gcc main.c -Wall -pedantic -O2 -m64 -lncursesw -o ttt -// - debug : gcc main.c -Wall -pedantic -g3 -m64 -lncursesw -o ttt -D DEBUG +// - release: gcc main.c -Wall -Werror -pedantic -O2 -m64 -lncursesw -o ttt +// - debug : gcc main.c -Wall -Werror -pedantic -g3 -m64 -lncursesw -o ttt -D DEBUG #include @@ -124,10 +124,10 @@ char *format_time(intmax_t time, char* string, int length) { sprintf(string, "%*s%02jd:%02jd%*s", left_padding, "", hours, minutes, right_padding, ""); } else if (time > 0) { - sprintf(string, "%*s%4jds%*s", left_padding, "", time, right_padding, ""); + sprintf(string, "%*s%3jds %*s", left_padding, "", time, right_padding, ""); } else if (time == 0) { - sprintf(string, "%*s", length, ""); + sprintf(string, "%*s 0 %*s", left_padding, "", right_padding, ""); } else { sprintf(string, "%*s - %*s", left_padding, "", right_padding, ""); @@ -1031,7 +1031,6 @@ int main(int argc, char *argv[]) { curs_set(1); // TODO Make cursor blink. mvgetnstr(row, 1, new_task->name, MAX_TASK_NAME-1); - // TODO Move this empty-name-cleaning code elsewhere. bool is_empty = true; int size = strlen(new_task->name); -- cgit v1.2.3