From fbe3a2155f81e39998d9aecdfe28bd6b94c599d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Sun, 13 Jun 2021 11:17:24 +0200 Subject: [PATCH] UptimeMeter: treat all non-positive values as error Bogus uptime measurements can result in wrap-arounds, leading to negative garbage values printed. --- UptimeMeter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UptimeMeter.c b/UptimeMeter.c index 51ceef8c..9036e539 100644 --- a/UptimeMeter.c +++ b/UptimeMeter.c @@ -19,7 +19,7 @@ static const int UptimeMeter_attributes[] = { static void UptimeMeter_updateValues(Meter* this) { int totalseconds = Platform_getUptime(); - if (totalseconds == -1) { + if (totalseconds <= 0) { xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "(unknown)"); return; }