UptimeMeter: treat all non-positive values as error

Bogus uptime measurements can result in wrap-arounds, leading to
negative garbage values printed.
main
Christian Göttsche 5 years ago committed by Benny Baumann
parent 11d2206f40
commit fbe3a2155f
  1. 2
      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;
}

Loading…
Cancel
Save