UptimeMeter: treat all non-positive values as error

Bogus uptime measurements can result in wrap-arounds, leading to
negative garbage values printed.
This commit is contained in:
Christian Göttsche 2021-06-13 11:17:24 +02:00 committed by Benny Baumann
parent 11d2206f40
commit fbe3a2155f

View File

@ -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;
}