1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2025-03-16 00:12:21 +00:00

Use strncmp() when checking battery name.

This commit is contained in:
Vilmos Nebehaj 2014-03-09 18:53:26 +01:00
parent ad92c60d6b
commit 3fb201bbc8

View File

@ -2106,7 +2106,7 @@ int get_battery_perct(const char *bat)
init_batteries();
if (!strcmp(bat, "all")) {
if (!strncmp(bat, "all", strlen(bat))) {
for (idx = 0; idx < MAX_BATTERY_COUNT; idx++) {
snprintf(battery, sizeof(battery) - 1, "BAT%d", idx);
remaining_capacity = get_battery_perct(battery);