From d8cb32ee4ea199534b6fc6d30367fc6975e67afb Mon Sep 17 00:00:00 2001 From: m Date: Fri, 25 Nov 2022 19:49:45 +0100 Subject: [PATCH] FAT16: Fix incorrect loop condition for root dir --- mfat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mfat.c b/mfat.c index e4760dd..14fbec3 100644 --- a/mfat.c +++ b/mfat.c @@ -969,7 +969,7 @@ static mfat_bool_t _mfat_find_file(int part_no, // Look up the file name in the directory. mfat_bool_t no_more_entries = false; - for (; file_entry == NULL && !no_more_entries && blocks_left > 0U; ++blocks_left) { + for (; file_entry == NULL && !no_more_entries && blocks_left > 0U; --blocks_left) { // Load the directory table block. block = _mfat_read_block(_mfat_cluster_pos_blk_no(&cpos), MFAT_CACHE_DATA); if (block == NULL) { -- 2.11.4.GIT