From 0aa790baac3942ba013794a3493ed5f679e9b0f6 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Thu, 2 Jul 2015 11:09:50 -0400 Subject: [PATCH] Correctly shorten unknown. --- src/linux.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/linux.cc b/src/linux.cc index 3584a1b2..ecbbe2ba 100644 --- a/src/linux.cc +++ b/src/linux.cc @@ -2101,10 +2101,11 @@ void get_battery_short_status(char *buffer, unsigned int n, const char *bat) } else if (0 == strncmp("empty", buffer, 5)) { buffer[0] = 'E'; memmove(buffer + 1, buffer + 5, n - 5); - } else if (0 != strncmp("AC", buffer, 2)) { + } else if (0 == strncmp("unknown", buffer, 7)) { buffer[0] = 'U'; - memmove(buffer + 1, buffer + 2, n - 2); + memmove(buffer + 1, buffer + 7, n - 7); } + // Otherwise, don't shorten. } int _get_battery_perct(const char *bat)