From 617ab30c5647f27d86d7f43df161431ad3bf3444 Mon Sep 17 00:00:00 2001 From: Gustavo Sverzut Barbieri Date: Tue, 4 Mar 2008 01:06:58 +0000 Subject: [PATCH] Integer overflow. This fixes my battery showing 18% for on power, fully charged battery, but possible there are many more of those. SVN revision: 33910 --- src/modules/battery/batget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/battery/batget.c b/src/modules/battery/batget.c index f7dc0d329..9589f17f5 100644 --- a/src/modules/battery/batget.c +++ b/src/modules/battery/batget.c @@ -770,7 +770,7 @@ linux_sys_class_power_supply_check(void) total_pwr_max += pwr_full - pwr_empty; } if (total_pwr_max > 0) - battery_full = (total_pwr_now * 100) / total_pwr_max; + battery_full = ((long long)total_pwr_now * 100) / total_pwr_max; } }