Skip to content

Commit 8f590d5

Browse files
authored
Merge pull request #23 from saethlin/master
Replace unaligned pointer deref with read_unaligned
2 parents 14cd007 + 4e35909 commit 8f590d5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/fixed.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ macro_rules! impl_fixedint {
5454
}
5555
fn decode_fixed(src: &[u8]) -> $t {
5656
assert_eq!(src.len(), Self::REQUIRED_SPACE);
57-
return unsafe { *(src.as_ptr() as *const $t) };
57+
return unsafe { (src.as_ptr() as *const $t).read_unaligned() };
5858
}
5959
}
6060
};

0 commit comments

Comments
 (0)