Merged from external project:
[bertos.git] / bertos / fs / battfs.c
index a10ef85f68d21192b7d0b140cad1bb29134708be..2410f42dd4f319b5daee9ce3a283235907b0b2d5 100644 (file)
@@ -875,7 +875,7 @@ static bool findFile(BattFsSuper *disk, inode_t inode, pgcnt_t *last)
                else if (hdr.fcs == fcs && hdr.inode < inode)
                        first = page + 1;
                else
-                       *last = page + 1;
+                       *last = page;
        }
        LOG_INFO("Not found: last %d\n", *last);
        return false;