Skip to content

Commit

Permalink
Was using wrong byte range when loading 16 bit ints.
Browse files Browse the repository at this point in the history
  • Loading branch information
billallen256 committed Nov 10, 2024
1 parent 929cdbd commit 19aa43c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ impl fmt::Display for ExtKeywordValue {
match self.format {
'A' | 'S' | 'Z' => write!(f, "\"{}\"", from_utf8(&self.raw_value).unwrap().replace('\"', "\\\"")),
'B' => write!(f, "{}", byte_to_i8(self.raw_value[0]).unwrap()),
'I' => write!(f, "{}", bytes_to_i16(&self.raw_value[0..1], self.endianness).unwrap()),
'I' => write!(f, "{}", bytes_to_i16(&self.raw_value[0..2], self.endianness).unwrap()),
'L' => write!(f, "{}", bytes_to_i32(&self.raw_value[0..4], self.endianness).unwrap()),
'X' => write!(f, "{}", bytes_to_i64(&self.raw_value[0..8], self.endianness).unwrap()),
'F' => write!(f, "{}", bytes_to_f32(&self.raw_value[0..4], self.endianness).unwrap()),
Expand Down

0 comments on commit 19aa43c

Please sign in to comment.