Skip to content

Commit 73c8554

Browse files
authored
[Rust] Fix load_with_options_and_progress when options is None
A similar fix was applied for `load_view_with_options` inhttps://github.com/Vector35/binaryninja-api/commit/ff58143ff7794d7251f9182294dd25bd4cbe15eb but was not applied here. This allows `None` to be correctly passed for options.
1 parent 698780b commit 73c8554

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

rust/src/lib.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ use crate::progress::{NoProgressCallback, ProgressCallback};
9494
use crate::string::raw_to_string;
9595
use binary_view::BinaryView;
9696
use binaryninjacore_sys::*;
97-
use metadata::Metadata;
98-
use metadata::MetadataType;
9997
use rc::Ref;
10098
use std::cmp;
10199
use std::collections::HashMap;
@@ -199,11 +197,7 @@ where
199197
.to_bytes_with_nul()
200198
.to_vec()
201199
} else {
202-
Metadata::new_of_type(MetadataType::KeyValueDataType)
203-
.get_json_string()
204-
.ok()?
205-
.as_ref()
206-
.to_vec()
200+
"{}".to_cstr().to_bytes_with_nul().to_vec()
207201
};
208202
let handle = unsafe {
209203
BNLoadFilename(

0 commit comments

Comments
 (0)