mirror of
https://github.com/xzeldon/htop.git
synced 2024-12-23 22:55:46 +00:00
never show nan%
This commit is contained in:
parent
8f230920cd
commit
5cc8998688
@ -64,6 +64,7 @@ static void CPUMeter_setValues(Meter* this, char* buffer, int size) {
|
||||
this->type->items = 3;
|
||||
cpu = MIN(100.0, MAX(0.0, (this->values[0]+this->values[1]+this->values[2])));
|
||||
}
|
||||
if (isnan(cpu)) cpu = 0.0;
|
||||
snprintf(buffer, size, "%5.1f%%", cpu );
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user