diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-06-13 11:17:24 +0200 |
---|---|---|
committer | Benny Baumann <BenBE@geshi.org> | 2021-07-18 07:47:16 +0200 |
commit | fbe3a2155f81e39998d9aecdfe28bd6b94c599d4 (patch) | |
tree | 81c96aa3771c06c0a75243261944e88c0a707b90 | |
parent | 11d2206f40dd1680923ccae6e421a494c2af0992 (diff) |
UptimeMeter: treat all non-positive values as error
Bogus uptime measurements can result in wrap-arounds, leading to
negative garbage values printed.
-rw-r--r-- | UptimeMeter.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |