diff options
Diffstat (limited to 'rust/src/headless.rs')
| -rw-r--r-- | rust/src/headless.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/rust/src/headless.rs b/rust/src/headless.rs index 0ce24cb3..c5e14eb0 100644 --- a/rust/src/headless.rs +++ b/rust/src/headless.rs @@ -12,8 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. +use crate::string::BnStrCompatible; + use std::env; -use std::ffi::CString; use std::path::PathBuf; #[cfg(not(target_os = "windows"))] @@ -72,9 +73,9 @@ use binaryninjacore_sys::{BNInitPlugins, BNInitRepoPlugins, BNSetBundledPluginDi pub fn init() { unsafe { let path = binja_path().join("plugins").into_os_string(); - let path = CString::new(path.into_string().unwrap()).unwrap(); + let path = path.into_string().unwrap(); - BNSetBundledPluginDirectory(path.as_ptr()); + BNSetBundledPluginDirectory(path.as_str().into_bytes_with_nul().as_ptr() as *mut _); BNInitPlugins(true); BNInitRepoPlugins(); } |
