mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-25 15:25:45 +00:00
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:
parent
11d2206f40
commit
fbe3a2155f
@ -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…
Reference in New Issue
Block a user