This website works better with JavaScript.
Home
Explore
Help
Sign In
rinri
/
slstatus
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
battery_remaining: check for division by zero
master
Aaron Marcher
6 years ago
parent
a546d4b585
commit
aa8654795d
1 changed files
with
4 additions
and
0 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+4
-0
components/battery.c
+ 4
- 0
components/battery.c
View File
@@ -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;
Write
Preview
Loading…
Cancel
Save