From da68f27b3ae05998618be2f3150f8caea5a474d7 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Thu, 8 Dec 2022 14:14:47 +0000 Subject: [PATCH] [FAT] Return current clusters when a file overflows the FAT. --- Aaru.Filesystems/FAT/File.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Aaru.Filesystems/FAT/File.cs b/Aaru.Filesystems/FAT/File.cs index 1708d1cf0..07cc6b827 100644 --- a/Aaru.Filesystems/FAT/File.cs +++ b/Aaru.Filesystems/FAT/File.cs @@ -268,8 +268,8 @@ public sealed partial class FAT else if(_fat16) while(nextCluster is > 0 and <= FAT16_RESERVED) { - if(nextCluster > _fatEntries.Length) - return null; + if(nextCluster >= _fatEntries.Length) + break; clusters.Add(nextCluster); nextCluster = _fatEntries[nextCluster]; @@ -277,8 +277,8 @@ public sealed partial class FAT else while(nextCluster is > 0 and <= FAT12_RESERVED) { - if(nextCluster > _fatEntries.Length) - return null; + if(nextCluster >= _fatEntries.Length) + break; clusters.Add(nextCluster); nextCluster = _fatEntries[nextCluster];