From 30ee8c06f79d74744decbb03efa373a71a1e8a42 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Sat, 6 Sep 2025 09:57:37 -0400 Subject: [PATCH] Fix off-by-one errors --- src/emulator/game_info.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emulator/game_info.rs b/src/emulator/game_info.rs index f42f93b..b3dc664 100644 --- a/src/emulator/game_info.rs +++ b/src/emulator/game_info.rs @@ -154,14 +154,14 @@ fn extract_isx_symbols(input: &[u8]) -> Option> { // Range (Virtual Boy) let count_bytes; (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)?; } 0x14 => { // Symbol (Virtual Boy) let count_bytes; (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 { let name_len; (name_len, buf) = buf.split_first()?;