Make sure we exit this hole

This commit is contained in:
Alastair Poole 2019-09-01 14:04:40 +01:00
parent 2c2930cc60
commit 37cb378cf9
1 changed files with 5 additions and 1 deletions

View File

@ -895,7 +895,11 @@ _battery_state_get(power_t *power, int *mib)
}
closedir(dir);
if (!naming) continue;
if (!naming)
{
i++;
continue;
}
snprintf(path, sizeof(path), "/sys/class/power_supply/%s/%s_full", power->battery_names[i], naming);
buf = Fcontents(path);