summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/print_battery_info.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/print_battery_info.c b/src/print_battery_info.c
index 36de3c8..6ee8989 100644
--- a/src/print_battery_info.c
+++ b/src/print_battery_info.c
@@ -17,7 +17,7 @@
* worn off your battery is.
*
*/
-void print_battery_info(int number, const char *format, bool last_full_capacity) {
+void print_battery_info(int number, const char *path, const char *format, bool last_full_capacity) {
time_t empty_time;
struct tm *empty_tm;
char buf[1024];
@@ -38,7 +38,7 @@ void print_battery_info(int number, const char *format, bool last_full_capacity)
#if defined(LINUX)
static char batpath[512];
- sprintf(batpath, "/sys/class/power_supply/BAT%d/uevent", number);
+ sprintf(batpath, path, number);
if (!slurp(batpath, buf, sizeof(buf))) {
printf("No battery");
return;