mirror of
https://github.com/pellepl/spiffs.git
synced 2026-09-13 20:50:01 +00:00
Fix eternal readdir when obj header at last block, last entry
Bug in spiffs_obj_lu_find_entry_visitor where it wrapped even if SPIFFS_VIS_NO_WRAP was set. Special case, if wrap needed at function entry. This gave eternal readdir loop if there was an object header at last block, in last entry
This commit is contained in:
@@ -142,9 +142,13 @@ s32_t spiffs_obj_lu_find_entry_visitor(
|
||||
cur_block++;
|
||||
cur_block_addr = cur_block * SPIFFS_CFG_LOG_BLOCK_SZ(fs);
|
||||
if (cur_block >= fs->block_count) {
|
||||
// block wrap
|
||||
cur_block = 0;
|
||||
cur_block_addr = 0;
|
||||
if (flags & SPIFFS_VIS_NO_WRAP) {
|
||||
return SPIFFS_VIS_END;
|
||||
} else {
|
||||
// block wrap
|
||||
cur_block = 0;
|
||||
cur_block_addr = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user