]> git.sur5r.net Git - i3/i3status/commitdiff
Bugfix: Check if the present rate is > 0, not only if it is not set
authorMichael Stapelberg <michael+x200@stapelberg.de>
Thu, 9 Apr 2009 17:11:07 +0000 (19:11 +0200)
committerMichael Stapelberg <michael+x200@stapelberg.de>
Thu, 9 Apr 2009 17:11:07 +0000 (19:11 +0200)
wmiistatus.c

index e1f1e68cd2742b8f98667ecb9af3e9f4f978547c..cba4d8b78e1c4df7348f2eea2fa2bb85498bbdf0 100644 (file)
@@ -307,7 +307,7 @@ static char *get_battery_info() {
                        last = walk+1;
        (void)close(fd);
 
-       if ((full_design != -1) && (remaining != -1) && (present_rate != -1)) {
+       if ((full_design != -1) && (remaining != -1) && (present_rate > 0)) {
                float remaining_time;
                int seconds, hours, minutes;
                if (status == CS_CHARGING)