Skip to content

Commit

Permalink
Checksum is now calculated correctly when using address units other t…
Browse files Browse the repository at this point in the history
…han byte
  • Loading branch information
fisherdog1 committed Apr 1, 2022
1 parent 3939fec commit ae72f73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/bitvec_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ impl util::BitVec

let mut checksum = 0_u8;
checksum = checksum.wrapping_add(bytes_in_row as u8);
checksum = checksum.wrapping_add(((index / 8) >> 8) as u8);
checksum = checksum.wrapping_add((index / 8) as u8);
checksum = checksum.wrapping_add(((index / addressunit) >> 8) as u8);
checksum = checksum.wrapping_add((index / addressunit) as u8);

for _ in 0..bytes_in_row
{
Expand Down

0 comments on commit ae72f73

Please sign in to comment.