From 54a5cb8cbba3745fed8323fc7adc9ef83a2ac3a7 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 2 Jul 2015 11:09:24 -0400 Subject: [PATCH] If we're on AC, there is no battery. Again, no point in having two ways to say the same thing. --- src/linux.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/linux.cc b/src/linux.cc index dd7830d4..3584a1b2 100644 --- a/src/linux.cc +++ b/src/linux.cc @@ -1898,7 +1898,7 @@ void get_battery_stuff(char *buffer, unsigned int n, const char *bat, int item) snprintf(last_battery_str[idx], 64, "unknown %d%%", (int) (((float)remaining_capacity / acpi_last_full[idx]) * 100)); else - strncpy(last_battery_str[idx], "AC", 64); + strncpy(last_battery_str[idx], "not present", 64); } } else if (acpi_bat_fp[idx] != NULL) { /* ACPI */ @@ -2029,7 +2029,7 @@ void get_battery_stuff(char *buffer, unsigned int n, const char *bat, int item) snprintf(last_battery_str[idx], 64, "unknown %d%%", (int) ((remaining_capacity * 100) / acpi_last_full[idx])); } else { - strncpy(last_battery_str[idx], "AC", 64); + strncpy(last_battery_str[idx], "not present", 64); } } fclose(acpi_bat_fp[idx]); @@ -2050,7 +2050,7 @@ void get_battery_stuff(char *buffer, unsigned int n, const char *bat, int item) if (life == -1) { /* could check now that there is ac */ - snprintf(last_battery_str[idx], 64, "AC"); + snprintf(last_battery_str[idx], 64, "not present"); /* could check that status == 3 here? */ } else if (ac && life != 100) {