Skip to content

Commit ea6f65c

Browse files
committed
auto merge of #20633 : vhbit/rust/ios-cstring, r=brson
2 parents 6539cb4 + 72e0800 commit ea6f65c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstd/os.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ fn real_args_as_bytes() -> Vec<Vec<u8>> {
646646
// res
647647
#[cfg(target_os = "ios")]
648648
fn real_args_as_bytes() -> Vec<Vec<u8>> {
649+
use ffi::c_str_to_bytes;
649650
use iter::range;
650651
use mem;
651652

@@ -680,8 +681,7 @@ fn real_args_as_bytes() -> Vec<Vec<u8>> {
680681
let tmp = objc_msgSend(args, objectAtSel, i);
681682
let utf_c_str: *const libc::c_char =
682683
mem::transmute(objc_msgSend(tmp, utf8Sel));
683-
let s = CString::new(utf_c_str, false);
684-
res.push(s.as_bytes_no_nul().to_vec())
684+
res.push(c_str_to_bytes(&utf_c_str).to_vec());
685685
}
686686
}
687687

0 commit comments

Comments
 (0)