aboutsummaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/service.c b/src/service.c
index 06a74de..be17a55 100644
--- a/src/service.c
+++ b/src/service.c
@@ -1342,10 +1342,12 @@ create_totalled_battery_device (const GList * devices)
const time_t t = indicator_power_device_get_time (walk);
const UpDeviceState state = indicator_power_device_get_state (walk);
- ++n_batteries;
if (percent > 0.01)
- sum_percent += percent;
+ {
+ sum_percent += percent;
+ ++n_batteries;
+ }
if (state == UP_DEVICE_STATE_CHARGING)
{