Skip to content

Commit bab8cc4

Browse files
authored
Merge pull request #6018 from bmcdonnell-ionx/fix-dir_seek-warn
fix compiler warning
2 parents c3e02b1 + 88cd13b commit bab8cc4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

features/filesystem/fat/FATFileSystem.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,13 +712,14 @@ ssize_t FATFileSystem::dir_read(fs_dir_t dir, struct dirent *ent)
712712
void FATFileSystem::dir_seek(fs_dir_t dir, off_t offset)
713713
{
714714
FATFS_DIR *dh = static_cast<FATFS_DIR*>(dir);
715+
off_t dptr = static_cast<off_t>(dh->dptr);
715716

716717
lock();
717718

718-
if (offset < dh->dptr) {
719+
if (offset < dptr) {
719720
f_rewinddir(dh);
720721
}
721-
while (dh->dptr < offset) {
722+
while (dptr < offset) {
722723
FILINFO finfo;
723724
FRESULT res;
724725

0 commit comments

Comments
 (0)