diff options
Diffstat (limited to 'components')
-rw-r--r-- | components/battery.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/battery.c b/components/battery.c index fa525be..8bfe42a 100644 --- a/components/battery.c +++ b/components/battery.c @@ -107,6 +107,10 @@ return NULL; } + if (current_now == 0) { + return NULL; + } + timeleft = (double)charge_now / (double)current_now; h = timeleft; m = (timeleft - (double)h) * 60; |