Skip to content

Commit

Permalink
fix: fix potential bug when File read stops at the end of a sector
Browse files Browse the repository at this point in the history
  • Loading branch information
Oakchris1955 committed Aug 11, 2024
1 parent df88fac commit 6eb9226
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,9 @@ where
if bytes_read >= read_cap {
// ...but we must process get the next cluster for future uses,
// we do that before breaking
if self.offset % self.fs.cluster_size() == 0 {
if self.offset % self.fs.cluster_size() == 0
&& self.offset < self.file_size.into()
{
self.next_cluster()?;
}

Expand Down

0 comments on commit 6eb9226

Please sign in to comment.