summaryrefslogtreecommitdiff
path: root/firmware/drivers/fat.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/drivers/fat.c')
-rw-r--r--firmware/drivers/fat.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/firmware/drivers/fat.c b/firmware/drivers/fat.c
index 15974f4cbc..9a81107725 100644
--- a/firmware/drivers/fat.c
+++ b/firmware/drivers/fat.c
@@ -891,7 +891,7 @@ int fat_read( struct fat_file *file, int sectorcount, void* buf )
891int fat_seek(struct fat_file *file, int seeksector ) 891int fat_seek(struct fat_file *file, int seeksector )
892{ 892{
893 int cluster = file->firstcluster; 893 int cluster = file->firstcluster;
894 int sector = seeksector; 894 int sector = cluster2sec(cluster);
895 int numsec = 0; 895 int numsec = 0;
896 int i; 896 int i;
897 897
@@ -913,11 +913,6 @@ int fat_seek(struct fat_file *file, int seeksector )
913 sector++; 913 sector++;
914 } 914 }
915 } 915 }
916 else {
917 sector = cluster2sec(cluster);
918 if (sector<0)
919 return -2;
920 }
921 916
922 file->nextcluster = cluster; 917 file->nextcluster = cluster;
923 file->nextsector = sector; 918 file->nextsector = sector;