diff options
| author | Rubens Brandao <git@rubens.io> | 2024-04-06 16:32:00 -0300 |
|---|---|---|
| committer | Kyle Martin <krm504@nyu.edu> | 2024-04-09 13:39:49 -0400 |
| commit | 193dea95daedde471e6f1fbcbeaf1932c6fbd50c (patch) | |
| tree | 99be67d81a899543ed5e4636eea3d589583e48a5 /rust/src/symbol.rs | |
| parent | a6b48153b64a227c3492d77a96e679b8c469034c (diff) | |
replace BStr with str
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() } } |
