Reads a C-style string from memory.
(&self, store: &Store, offset: usize, len: usize)
| 291 | |
| 292 | /// Reads a C-style string from memory. |
| 293 | pub fn read_cstring(&self, store: &Store, offset: usize, len: usize) -> Result<CString> { |
| 294 | CString::from_vec_with_nul(self.read_vec(store, offset, len)?) |
| 295 | .map_err(|e| crate::Error::Other(format!("Invalid C-style string: {e}"))) |
| 296 | } |
| 297 | |
| 298 | /// Reads a C-style string from memory, stopping at the first null byte. |
| 299 | pub fn read_cstring_until_null(&self, store: &Store, offset: usize, max_len: usize) -> Result<CString> { |