fixed possible segfault

git-svn-id: http://tint2.googlecode.com/svn/trunk@76 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
lorthiois@bbsoft.fr 2009-05-16 15:43:48 +00:00
parent 88661d034a
commit 466f4fb1db

View file

@ -100,6 +100,7 @@ void update_battery(struct batstate *data) {
seconds -= 60 * data->time.minutes; seconds -= 60 * data->time.minutes;
data->time.seconds = seconds; data->time.seconds = seconds;
if(energy_full > 0)
new_percentage = (energy_now*100)/energy_full; new_percentage = (energy_now*100)/energy_full;
if(battery_low_status != 0 && battery_low_status == new_percentage && data->percentage > new_percentage) { if(battery_low_status != 0 && battery_low_status == new_percentage && data->percentage > new_percentage) {