Skip to content

Commit

Permalink
Fix a bug in getter when a bitfield spans for more than 3 bytes
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbepop committed May 24, 2019
1 parent 1354f30 commit 118fcfc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion impl/src/bitfield.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ impl BitfieldStruct {

if ms_byte - ls_byte >= 2 {
// Middle bytes
for byte in &self.data[(ls_byte + 1)..ms_byte] {
for byte in self.data[(ls_byte + 1)..ms_byte].iter().rev() {
buffer.push_bits(8, *byte);
}
}
Expand Down

0 comments on commit 118fcfc

Please sign in to comment.