never show nan%

This commit is contained in:
Hisham Muhammad 2010-02-25 01:40:14 +00:00
parent 8f230920cd
commit 5cc8998688

View File

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