Update offset in Peek/CPeek trait from usize to u64

This commit is contained in:
2025-08-13 11:18:00 +08:00
parent b9ee9d1e42
commit 270a2d9fdf
11 changed files with 91 additions and 93 deletions

View File

@@ -451,13 +451,13 @@ impl<'a> V1Parser<'a> {
pub fn is_empty_string(&self, address: usize) -> Result<bool> {
let start = self.offset + address;
let data = self.buf.cpeek_u8_at(start)?;
let data = self.buf.cpeek_u8_at(start as u64)?;
Ok(data == 0)
}
pub fn read_string_at_address(&mut self, address: usize) -> Result<String> {
let start = self.offset + address;
let buf = self.buf.peek_cstring_at(start)?;
let buf = self.buf.peek_cstring_at(start as u64)?;
// Sometimes string has private use area characters, so we disable strict checking
Ok(decode_to_string(self.encoding, buf.as_bytes(), false)?)
}