Skip to content

Commit

Permalink
Merge pull request #23 from saethlin/master
Browse files Browse the repository at this point in the history
Replace unaligned pointer deref with read_unaligned
  • Loading branch information
dermesser authored Feb 22, 2022
2 parents 14cd007 + 4e35909 commit 8f590d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/fixed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ macro_rules! impl_fixedint {
}
fn decode_fixed(src: &[u8]) -> $t {
assert_eq!(src.len(), Self::REQUIRED_SPACE);
return unsafe { *(src.as_ptr() as *const $t) };
return unsafe { (src.as_ptr() as *const $t).read_unaligned() };
}
}
};
Expand Down

0 comments on commit 8f590d5

Please sign in to comment.