Fixed silly mistake in cluster index calculation.
git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/trunk@899 6ac86273-5f31-0410-b378-82cca8765d1b
This commit is contained in:
parent
490a27b857
commit
6f7b41e257
@ -177,7 +177,7 @@ unsigned link_fat(struct dpb FAR * dpbp, CLUSTER Cluster1,
|
||||
|
||||
/* form an index so that we can read the block as a */
|
||||
/* byte array */
|
||||
idx = (((unsigned)Cluster1 << 1) + (unsigned)Cluster1) % dpbp->dpb_secsize;
|
||||
idx = (((unsigned)Cluster1 >> 1) + (unsigned)Cluster1) % dpbp->dpb_secsize;
|
||||
|
||||
/* Test to see if the cluster straddles the block. If */
|
||||
/* it does, get the next block and use both to form the */
|
||||
@ -294,7 +294,7 @@ CLUSTER next_cluster(struct dpb FAR * dpbp, CLUSTER ClusterNum)
|
||||
|
||||
/* form an index so that we can read the block as a */
|
||||
/* byte array */
|
||||
idx = ((((unsigned)ClusterNum << 1) + (unsigned)ClusterNum) >> 1) %
|
||||
idx = (((unsigned)ClusterNum >> 1) + (unsigned)ClusterNum) %
|
||||
dpbp->dpb_secsize;
|
||||
|
||||
clusterbuff.bytes[0] = bp->b_buffer[idx];
|
||||
|
Loading…
Reference in New Issue
Block a user