On laptops with builtin batteries, disconnecting the battery may show up as
a battery without any capacity information. (The theory is that one is
disconnecting the cells but the electronics identifying the battery are
still connected.) As a result, the loop over all batteries in
acpi_battery_get_battinfo results in total_lfcap == 0.
So, just check that total_lfcap is non-zero to avoid a division by zero
(triggerable by sysctl hw.acpi.battery).
Reported/tested by: Stefano Marinelli