/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <stdio.h>
#include <string.h>
return NULL;
}
+ if (current_now == 0) {
+ return NULL;
+ }
+
timeleft = (double)charge_now / (double)current_now;
h = timeleft;
m = (timeleft - (double)h) * 60;