From 02b4992e9d3b63bd5eb397d7bbed9936bd2004c4 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Thu, 9 Apr 2009 19:11:07 +0200 Subject: [PATCH] Bugfix: Check if the present rate is > 0, not only if it is not set --- wmiistatus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wmiistatus.c b/wmiistatus.c index e1f1e68..cba4d8b 100644 --- a/wmiistatus.c +++ b/wmiistatus.c @@ -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) -- 2.39.5