From 7f77d19460cbb34c49321e5c39fcc2568882ae36 Mon Sep 17 00:00:00 2001 From: Dave Murphy Date: Tue, 12 Oct 2010 11:36:42 +0000 Subject: [PATCH] last cluster is valid for allocation --- source/file_allocation_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/file_allocation_table.c b/source/file_allocation_table.c index 639a637..7edd7cb 100644 --- a/source/file_allocation_table.c +++ b/source/file_allocation_table.c @@ -246,7 +246,7 @@ uint32_t _FAT_fat_linkFreeCluster(PARTITION* partition, uint32_t cluster) { } partition->fat.firstFree = firstFree; - if ((cluster >= CLUSTER_FIRST) && (cluster < lastCluster)) + if ((cluster >= CLUSTER_FIRST) && (cluster <= lastCluster)) { // Update the linked from FAT entry _FAT_fat_writeFatEntry (partition, cluster, firstFree);