1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-27 20:44:56 +00:00

Correctly shorten unknown.

This commit is contained in:
Steven Allen 2015-07-02 11:09:50 -04:00
parent 54a5cb8cbb
commit 0aa790baac

View File

@ -2101,10 +2101,11 @@ void get_battery_short_status(char *buffer, unsigned int n, const char *bat)
} else if (0 == strncmp("empty", buffer, 5)) { } else if (0 == strncmp("empty", buffer, 5)) {
buffer[0] = 'E'; buffer[0] = 'E';
memmove(buffer + 1, buffer + 5, n - 5); memmove(buffer + 1, buffer + 5, n - 5);
} else if (0 != strncmp("AC", buffer, 2)) { } else if (0 == strncmp("unknown", buffer, 7)) {
buffer[0] = 'U'; 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) int _get_battery_perct(const char *bat)