Skip to content

Commit

Permalink
revert part of off-by-one
Browse files Browse the repository at this point in the history
  • Loading branch information
cvhammond committed Aug 21, 2023
1 parent c6dc689 commit 4c7f9a1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/c3d.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ impl C3d {
.u16([self.bytes.header[16], self.bytes.header[17]]) as usize;

let mut parameter_bytes_tail = Vec::with_capacity(
(self.bytes.data_start_block_index - self.bytes.parameter_start_block_index) * 512,
(self.bytes.data_start_block_index - self.bytes.parameter_start_block_index - 1) * 512,
) as Vec<u8>;

for _ in 0..(self.bytes.data_start_block_index - self.bytes.parameter_start_block_index)
for _ in 0..(self.bytes.data_start_block_index - self.bytes.parameter_start_block_index - 1)
{
let mut block = [0u8; 512];
file.read_exact(&mut block)
Expand Down

0 comments on commit 4c7f9a1

Please sign in to comment.