From 193dea95daedde471e6f1fbcbeaf1932c6fbd50c Mon Sep 17 00:00:00 2001 From: Rubens Brandao Date: Sat, 6 Apr 2024 16:32:00 -0300 Subject: replace BStr with str --- rust/src/interaction.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'rust/src/interaction.rs') diff --git a/rust/src/interaction.rs b/rust/src/interaction.rs index 7e549253..ccb5c81a 100644 --- a/rust/src/interaction.rs +++ b/rust/src/interaction.rs @@ -16,12 +16,13 @@ use binaryninjacore_sys::*; +use std::ffi::CStr; use std::os::raw::{c_char, c_void}; use std::path::PathBuf; use crate::binaryview::BinaryView; use crate::rc::Ref; -use crate::string::{BnStr, BnStrCompatible, BnString}; +use crate::string::{BnStrCompatible, BnString}; pub fn get_text_line_input(prompt: &str, title: &str) -> Option { let mut value: *mut libc::c_char = std::ptr::null_mut(); @@ -499,7 +500,10 @@ impl FormInputBuilder { | BNFormInputFieldType::SaveFileNameFormField | BNFormInputFieldType::DirectoryNameFormField => { FormResponses::String(unsafe { - BnStr::from_raw(form_field.stringResult).to_string() + CStr::from_ptr(form_field.stringResult) + .to_str() + .unwrap() + .to_owned() }) } -- cgit v1.3.1