From 7753750fa76482a775d838ceed9a242c1dde260b Mon Sep 17 00:00:00 2001 From: Alex Voinea Date: Wed, 27 Nov 2019 17:31:47 +0200 Subject: [PATCH] Change for to while --- Firmware/cardreader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Firmware/cardreader.cpp b/Firmware/cardreader.cpp index 1bbfca02..d925f2cb 100644 --- a/Firmware/cardreader.cpp +++ b/Firmware/cardreader.cpp @@ -870,9 +870,9 @@ void CardReader::presort() { getfilename_simple(positions[sort_order[j - gap]]); char *name2 = LONGEST_FILENAME; // use the string in-place #if HAS_FOLDER_SORTING - for (; j >= gap && ((sdSort == SD_SORT_TIME)?(_SORT_CMP_TIME_DIR(FOLDER_SORTING)):(_SORT_CMP_DIR(FOLDER_SORTING)));) + while (j >= gap && ((sdSort == SD_SORT_TIME)?_SORT_CMP_TIME_DIR(FOLDER_SORTING):_SORT_CMP_DIR(FOLDER_SORTING))) #else - for (; j >= gap && ((sdSort == SD_SORT_TIME)?(_SORT_CMP_TIME_NODIR()):(_SORT_CMP_NODIR()));) + while (j >= gap && ((sdSort == SD_SORT_TIME)?_SORT_CMP_TIME_NODIR():_SORT_CMP_NODIR())) #endif { sort_order[j] = sort_order[j - gap];