From 10b844851145fd041036603d4b56d17aa9d04ec5 Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sun, 15 Dec 2024 15:32:34 -0500 Subject: [PATCH] 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 --- apps/menus/main_menu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/menus/main_menu.c b/apps/menus/main_menu.c index 579c651108..f16fce9487 100644 --- a/apps/menus/main_menu.c +++ b/apps/menus/main_menu.c @@ -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);