- else {\r
- // TODO: Bounds checking on root\r
-// LOG("Root cluster count %i", disk->bootsect.files_in_root*32/disk->BytesPerCluster);\r
- // Increment by clusters in offset\r
- cluster += Offset / disk->BytesPerCluster;\r
+\r
+ // Do Cluster Skip\r
+ skip = Offset / disk->BytesPerCluster;\r
+ LOG("skip = %i", skip);\r
+ // Skip previous clusters\r
+ for(; skip-- ; )\r
+ {\r
+ if(Cluster) *Cluster = cluster;\r
+ cluster = FAT_int_GetFatValue(disk, cluster);\r
+ // Check for end of cluster chain\r
+ if(cluster == GETFATVALUE_EOC) { LEAVE('i', 1); return 1; }\r