Skip to content

Commit

Permalink
changed check extended id vs standard id
Browse files Browse the repository at this point in the history
as requested by #13 (review)
  • Loading branch information
erzoe committed Feb 7, 2024
1 parent 04cf4f5 commit 5d20fa8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ fn byte_order(s: &str) -> IResult<&str, ByteOrder> {
fn message_id(s: &str) -> IResult<&str, MessageId> {
let (s, parsed_value) = complete::u32(s)?;

if parsed_value > u16::MAX as u32 {
if parsed_value & (1 << 31) != 0 {
let extended_value = parsed_value & u32::from(u16::MAX);
Ok((s, MessageId::Extended(extended_value & 0x1FFFFFFF)))
} else {
Expand Down

0 comments on commit 5d20fa8

Please # to comment.