From 0b0d50c50ebf4ea120440d2eb7d91dda11628898 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 8 Apr 2024 12:50:42 +0200 Subject: Row_printNanoseconds fixes Don't print twice for 0.9s. Don't truncate on 1.2s, leading to an abort. --- Row.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Row.c b/Row.c index 66a4aa07..383257d9 100644 --- a/Row.c +++ b/Row.c @@ -425,13 +425,14 @@ void Row_printNanoseconds(RichString* str, unsigned long long totalNanoseconds, if (totalMicroseconds < 1000000) { len = xSnprintf(buffer, sizeof(buffer), ".%06lus ", (unsigned long)totalMicroseconds); RichString_appendnAscii(str, baseColor, buffer, len); + return; } unsigned long long totalSeconds = totalMicroseconds / 1000000; unsigned long microseconds = totalMicroseconds % 1000000; if (totalSeconds < 60) { int width = 5; - unsigned long fraction = microseconds; + unsigned long fraction = microseconds / 10; if (totalSeconds >= 10) { width--; fraction /= 10; -- cgit v1.2.3