From 5d20fa8c0ab10c703f1e99ceee89174e2c2d290e Mon Sep 17 00:00:00 2001 From: erzoe Date: Wed, 7 Feb 2024 07:52:15 +0100 Subject: [PATCH] changed check extended id vs standard id as requested by https://github.com/marcelbuesing/can-dbc/pull/13#pullrequestreview-1866333726 --- src/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser.rs b/src/parser.rs index 6c1af98..e440d34 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -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 {