Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/oofatfs/ff.c
Original file line number Diff line number Diff line change
Expand Up @@ -4116,7 +4116,7 @@ FRESULT f_lseek (
DWORD clst, bcs, nsect;
FSIZE_t ifptr;
#if FF_USE_FASTSEEK
DWORD cl, pcl, ncl, tcl, dsc, tlen, ulen, *tbl;
DWORD cl, pcl, ncl, nclst, tcl, dsc, tlen, ulen, *tbl;
#endif

res = validate(&fp->obj, &fs); /* Check validity of the file object */
Expand All @@ -4132,14 +4132,15 @@ FRESULT f_lseek (
if (fp->cltbl) { /* Fast seek */
if (ofs == CREATE_LINKMAP) { /* Create CLMT */
tbl = fp->cltbl;
tlen = *tbl++; ulen = 2; /* Given table size and required table size */
tlen = *tbl++; ulen = 2; nclst = 0; /* Given table size and required table size */
cl = fp->obj.sclust; /* Origin of the chain */
if (cl != 0) {
do {
/* Get a fragment */
tcl = cl; ncl = 0; ulen += 2; /* Top, length and used items */
do {
pcl = cl; ncl++;
if (++nclst > fs->n_fatent) ABORT(fs, FR_INT_ERR); /* Abort a cyclic chain */
cl = get_fat(&fp->obj, cl);
if (cl <= 1) ABORT(fs, FR_INT_ERR);
if (cl == 0xFFFFFFFF) ABORT(fs, FR_DISK_ERR);
Expand Down
Loading