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
This commit is contained in:
Gustavo Sverzut Barbieri 2008-03-04 01:06:58 +00:00
parent 55b40f3d3b
commit 617ab30c56
1 changed files with 1 additions and 1 deletions

View File

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