Fix off-by-one errors
This commit is contained in:
parent
1c146590fe
commit
30ee8c06f7
|
@ -154,14 +154,14 @@ fn extract_isx_symbols(input: &[u8]) -> Option<Vec<Symbol>> {
|
||||||
// Range (Virtual Boy)
|
// Range (Virtual Boy)
|
||||||
let count_bytes;
|
let count_bytes;
|
||||||
(count_bytes, buf) = buf.split_first_chunk()?;
|
(count_bytes, buf) = buf.split_first_chunk()?;
|
||||||
let count = u16::from_le_bytes(*count_bytes) + 1;
|
let count = u16::from_le_bytes(*count_bytes);
|
||||||
(_, buf) = buf.split_at_checked(count as usize * 9)?;
|
(_, buf) = buf.split_at_checked(count as usize * 9)?;
|
||||||
}
|
}
|
||||||
0x14 => {
|
0x14 => {
|
||||||
// Symbol (Virtual Boy)
|
// Symbol (Virtual Boy)
|
||||||
let count_bytes;
|
let count_bytes;
|
||||||
(count_bytes, buf) = buf.split_first_chunk()?;
|
(count_bytes, buf) = buf.split_first_chunk()?;
|
||||||
let count = u16::from_le_bytes(*count_bytes) + 1;
|
let count = u16::from_le_bytes(*count_bytes);
|
||||||
for _ in 0..count {
|
for _ in 0..count {
|
||||||
let name_len;
|
let name_len;
|
||||||
(name_len, buf) = buf.split_first()?;
|
(name_len, buf) = buf.split_first()?;
|
||||||
|
|
Loading…
Reference in New Issue