summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nielsen Feltzing <linus@haxx.se>2002-05-27 14:04:18 +0000
committerLinus Nielsen Feltzing <linus@haxx.se>2002-05-27 14:04:18 +0000
commit14a20d54b382081b651b63a535a04dc74f01130b (patch)
tree2d84901f1b929752eed7db195393ed709ea29ea6
parent76d0c7d790cfdcad7e4771f09f02a222571d0c25 (diff)
fat_seek couldn't seek in the first cluster
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@751 a1c6a512-1295-4272-9138-f99709370657
-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 )
int fat_seek(struct fat_file *file, int seeksector )
{
int cluster = file->firstcluster;
- int sector = seeksector;
+ int sector = cluster2sec(cluster);
int numsec = 0;
int i;
@@ -913,11 +913,6 @@ int fat_seek(struct fat_file *file, int seeksector )
sector++;
}
}
- else {
- sector = cluster2sec(cluster);
- if (sector<0)
- return -2;
- }
file->nextcluster = cluster;
file->nextsector = sector;