Skip to content

Commit c919b79

Browse files
luqmanaDanny Milosavljevic
authored and
Danny Milosavljevic
committed
Fix dumping blobs larger than 8k.
1 parent 9ccc964 commit c919b79

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -496,16 +496,17 @@ fn save_bhd_directory<T: FlashRead + FlashWrite>(
496496

497497
fn transfer_from_flash_to_io<T: FlashRead + FlashWrite>(
498498
storage: &T,
499-
beginning: Location,
499+
mut off: Location,
500500
mut size: usize,
501501
destination: &mut impl std::io::Write,
502502
) {
503503
let mut buffer = [0u8; 8192];
504504
while size > 0 {
505505
let chunk_size = min(buffer.len(), size);
506-
storage.read_exact(beginning, &mut buffer[..chunk_size]).unwrap();
506+
storage.read_exact(off, &mut buffer[..chunk_size]).unwrap();
507507
destination.write_all(&buffer[..chunk_size]).unwrap();
508-
size = size - chunk_size;
508+
size -= chunk_size;
509+
off += chunk_size as u32;
509510
}
510511
}
511512

0 commit comments

Comments
 (0)