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:
parent
ad92c60d6b
commit
3fb201bbc8
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user