summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Göttsche <cgzones@googlemail.com>2023-11-05 17:03:30 +0100
committercgzones <cgzones@googlemail.com>2024-03-27 19:49:23 +0100
commitec608672cea2b857a7b43832bfabae2bbe6c04da (patch)
tree81621b9f7e922273606969640257d05fa0208074
parent4e340c1817aaf61068aa746aad00197d969250b3 (diff)
Short circuit zero time in Row_printTime()
Bail out early if the passed time is 0 and shadow the result.
-rw-r--r--Row.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/Row.c b/Row.c
index f866c0f6..846a353d 100644
--- a/Row.c
+++ b/Row.c
@@ -337,6 +337,14 @@ void Row_printTime(RichString* str, unsigned long long totalHundredths, bool col
char buffer[10];
int len;
+ if (totalHundredths == 0) {
+ int shadowColor = coloring ? CRT_colors[PROCESS_SHADOW] : CRT_colors[PROCESS];
+
+ len = xSnprintf(buffer, sizeof(buffer), " 0:00.00 ");
+ RichString_appendnAscii(str, shadowColor, buffer, len);
+ return;
+ }
+
int yearColor = coloring ? CRT_colors[LARGE_NUMBER] : CRT_colors[PROCESS];
int dayColor = coloring ? CRT_colors[PROCESS_GIGABYTES] : CRT_colors[PROCESS];
int hourColor = coloring ? CRT_colors[PROCESS_MEGABYTES] : CRT_colors[PROCESS];

© 2014-2024 Faster IT GmbH | imprint | privacy policy