From 44c36c65cc2239c587553dd4f5f872bd0d408beb Mon Sep 17 00:00:00 2001 From: KrahJohlito Date: Thu, 5 Aug 2021 21:00:51 +0930 Subject: [PATCH] opl.c fix loop conditions --- src/opl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/opl.c b/src/opl.c index 3371ffd2c..1a56f913b 100644 --- a/src/opl.c +++ b/src/opl.c @@ -533,7 +533,7 @@ config_set_t *oplGetLegacyAppsConfig(void) return appConfig; } - for (i = MODE_COUNT; i >= 0; i--) { + for (i = MODE_COUNT - 1; i >= 0; i--) { listSupport = list_support[i].support; if ((listSupport != NULL) && (listSupport->enabled) && (listSupport->itemGetLegacyAppsPath != NULL)) { listSupport->itemGetLegacyAppsPath(appsPath, sizeof(appsPath)); @@ -561,7 +561,7 @@ config_set_t *oplGetLegacyAppsInfo(char *name) config_set_t *appConfig; char appsPath[128]; - for (i = MODE_COUNT; i >= 0; i--) { + for (i = MODE_COUNT - 1; i >= 0; i--) { listSupport = list_support[i].support; if ((listSupport != NULL) && (listSupport->enabled) && (listSupport->itemGetLegacyAppsInfo != NULL)) { listSupport->itemGetLegacyAppsInfo(appsPath, sizeof(appsPath), name);