Don't use CHECK_VOL(x) as a loop conditional

...On non-multidrive targets it will always evaluate to true because
it effectively ignores the argument passed in.

Instead use 'x < NUM_VOLUMES'

Fixes regression introduced with a41a001258 on non-multivolume devices

Change-Id: I1a620af113c87cf3227ef8b40d0b51b2600cd816
This commit is contained in:
Solomon Peachy 2024-12-15 15:32:34 -05:00
parent 843157e227
commit 10b8448511

View file

@ -172,7 +172,7 @@ static int refresh_data(struct info_data *info)
int special = 0;
#endif
int drive = 0;
for (i = 0 ; CHECK_VOL(i) ; i++)
for (i = 0 ; i < NUM_VOLUMES ; i++)
#endif
{
volume_size(IF_MV(i,) &info->size[i], &info->free[i]);
@ -353,7 +353,7 @@ static int info_action_callback(int action, struct gui_synclist *lists)
info->new_data = true;
splash(0, ID2P(LANG_SCANNING_DISK));
#if (CONFIG_PLATFORM & PLATFORM_NATIVE)
for (int i = 0; CHECK_VOL(i); i++)
for (int i = 0; i < NUM_VOLUMES; i++)
volume_recalc_free(IF_MV(i));
#endif
gui_synclist_speak_item(lists);
@ -438,7 +438,7 @@ static int info_action_callback(int action, struct gui_synclist *lists)
}
#endif
/* INFO_DISK, capacity/free on internal */
for (int i = 0; CHECK_VOL(i) ; i++) {
for (int i = 0; i < NUM_VOLUMES ; i++) {
if (info->size[i]) {
output_dyn_value(s1, sizeof s1, info->free[i], kibyte_units, 3, true);
output_dyn_value(s2, sizeof s2, info->size[i], kibyte_units, 3, true);