Skip to content

Commit 46b2c9a

Browse files
committed
iOS: CStr fallout
1 parent 522d09d commit 46b2c9a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/libstd/os.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ fn real_args_as_bytes() -> Vec<Vec<u8>> {
595595
// res
596596
#[cfg(target_os = "ios")]
597597
fn real_args_as_bytes() -> Vec<Vec<u8>> {
598-
use ffi::c_str_to_bytes;
598+
use ffi::CStr;
599599
use iter::range;
600600
use mem;
601601

@@ -630,7 +630,7 @@ fn real_args_as_bytes() -> Vec<Vec<u8>> {
630630
let tmp = objc_msgSend(args, objectAtSel, i);
631631
let utf_c_str: *const libc::c_char =
632632
mem::transmute(objc_msgSend(tmp, utf8Sel));
633-
res.push(c_str_to_bytes(&utf_c_str).to_vec());
633+
res.push(CStr::from_ptr(utf_c_str).to_bytes().to_vec());
634634
}
635635
}
636636

0 commit comments

Comments
 (0)