diff options
Diffstat (limited to 'rust/src/symbol.rs')
| -rw-r--r-- | rust/src/symbol.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/rust/src/symbol.rs b/rust/src/symbol.rs index 25801eee..cf4c3b10 100644 --- a/rust/src/symbol.rs +++ b/rust/src/symbol.rs @@ -14,6 +14,7 @@ //! Interfaces for the various kinds of symbols in a binary. +use std::ffi::CStr; use std::fmt; use std::hash::{Hash, Hasher}; use std::ptr; @@ -252,17 +253,17 @@ impl Symbol { } } - pub fn short_name(&self) -> BnString { + pub fn short_name(&self) -> &str { unsafe { let name = BNGetSymbolShortName(self.handle); - BnString::from_raw(name) + CStr::from_ptr(name).to_str().unwrap() } } - pub fn raw_name(&self) -> BnString { + pub fn raw_name(&self) -> &str { unsafe { let name = BNGetSymbolRawName(self.handle); - BnString::from_raw(name) + CStr::from_ptr(name).to_str().unwrap() } } |
