Commit 655c29bc authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

Fix display of nan% in CPU meters

(Fix by Steven Hampson)
parent 65bc58ed
...@@ -47,7 +47,7 @@ static void CPUMeter_setValues(Meter* this, char* buffer, int size) { ...@@ -47,7 +47,7 @@ static void CPUMeter_setValues(Meter* this, char* buffer, int size) {
snprintf(buffer, size, "absent"); snprintf(buffer, size, "absent");
return; return;
} }
double total = (double) pl->totalPeriod[processor]; double total = (double) (pl->totalPeriod[processor] == 0 ? 1 : pl->totalPeriod[processor]);
double cpu; double cpu;
this->values[0] = pl->nicePeriod[processor] / total * 100.0; this->values[0] = pl->nicePeriod[processor] / total * 100.0;
this->values[1] = pl->userPeriod[processor] / total * 100.0; this->values[1] = pl->userPeriod[processor] / total * 100.0;
......
...@@ -9,6 +9,8 @@ What's new in version 0.8.4 ...@@ -9,6 +9,8 @@ What's new in version 0.8.4
(thanks to Tom Callaway) (thanks to Tom Callaway)
* getopt-based long options and --no-color * getopt-based long options and --no-color
(thanks to Vincent Launchbury) (thanks to Vincent Launchbury)
* BUGFIX: Fix display of nan% in CPU meters
(thanks to Steven Hampson)
* BUGFIX: Fix memory leak * BUGFIX: Fix memory leak
(thanks to Pavol Rusnak) (thanks to Pavol Rusnak)
* Add Bash/emacs style navigation keys * Add Bash/emacs style navigation keys
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment