From 0b892e8479a03e124f9485ee7a5fa3f5f9a74687 Mon Sep 17 00:00:00 2001 From: Blair Campbell Date: Tue, 25 Jul 2006 02:33:01 +0000 Subject: [PATCH] Bugfix for certain FAT32 files git-svn-id: https://svn.code.sf.net/p/freedos/svn/kernel/branches/UNSTABLE@1253 6ac86273-5f31-0410-b378-82cca8765d1b --- kernel/fattab.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/fattab.c b/kernel/fattab.c index f6aafe2..07a02e4 100644 --- a/kernel/fattab.c +++ b/kernel/fattab.c @@ -274,7 +274,7 @@ CLUSTER link_fat(struct dpb FAR * dpbp, CLUSTER Cluster1, { /* form an index so that we can read the block as a */ /* byte array */ - UDWORD res = fgetlong(&bp->b_buffer[idx * 4]); + UDWORD res = fgetlong(&bp->b_buffer[idx * 4]) & LONG_LAST_CLUSTER; if (Cluster2 == READ_CLUSTER) { if (res > LONG_BAD) @@ -284,7 +284,7 @@ CLUSTER link_fat(struct dpb FAR * dpbp, CLUSTER Cluster1, } /* Finally, put the word into the buffer and mark the */ /* buffer as dirty. */ - fputlong(&bp->b_buffer[idx * 4], Cluster2); + fputlong(&bp->b_buffer[idx * 4], Cluster2 & LONG_LAST_CLUSTER); if (res == FREE) wasfree++; }