Skip to content

Commit 71c884d

Browse files
committed
build paths elsewhere because of NUL-terminator shenanigans
1 parent d6549df commit 71c884d

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

srcwr💾/src/lib.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ use extshared::cpp_add_frame_action;
1919
use extshared::cpp_extension_log_error;
2020
use extshared::cpp_forward_execute;
2121
use extshared::cpp_forward_push_cell;
22-
use extshared::strxx;
2322

2423
extshared::smext_conf_boilerplate_extension_info!(description, version, author, datestring, url, logtag, license, load);
2524
#[unsafe(no_mangle)]
@@ -86,9 +85,9 @@ pub extern "C" fn rust_post_to_replay_thread(
8685
unsafe {
8786
let len = pathsarray.size;
8887
for i in 0..len {
89-
let s = strxx(ICellArray_at(pathsarray, i), false, 0).unwrap_or_default().to_string();
90-
if !pathsvec.contains(&s) {
91-
pathsvec.push(s);
88+
let path = extshared::build_path(ICellArray_at(pathsarray, i) as *const u8, extshared::PathType::Path_Game);
89+
if !pathsvec.contains(&path) {
90+
pathsvec.push(path);
9291
}
9392
}
9493
}
@@ -120,7 +119,6 @@ fn replay_thread(recv: Receiver<Msg>) {
120119
let mut writers = vec![];
121120

122121
for path in &msg.friendly_paths {
123-
let path = extshared::build_path(path.as_ptr(), extshared::PathType::Path_Game);
124122
let tmp = path.clone() + ".tmp";
125123
if let Ok(f) = std::fs::File::create(&tmp).map(std::io::BufWriter::new) {
126124
writers.push((path, tmp, f));

0 commit comments

Comments
 (0)