summaryrefslogtreecommitdiffstats
path: root/BatteryMeter.c
diff options
context:
space:
mode:
Diffstat (limited to 'BatteryMeter.c')
-rw-r--r--BatteryMeter.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/BatteryMeter.c b/BatteryMeter.c
index 33d17b73..24b2e682 100644
--- a/BatteryMeter.c
+++ b/BatteryMeter.c
@@ -12,6 +12,7 @@ This meter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
#include <math.h>
#include "CRT.h"
+#include "Macros.h"
#include "Object.h"
#include "Platform.h"
#include "XUtils.h"
@@ -27,7 +28,7 @@ static void BatteryMeter_updateValues(Meter* this) {
Platform_getBattery(&percent, &isOnAC);
- if (isnan(percent)) {
+ if (!isNonnegative(percent)) {
this->values[0] = NAN;
xSnprintf(this->txtBuffer, sizeof(this->txtBuffer), "N/A");
return;