iOS: CString fallout
This commit is contained in:
parent
340ac040f7
commit
72e08006da
|
@ -646,6 +646,7 @@ fn real_args_as_bytes() -> Vec<Vec<u8>> {
|
||||||
// res
|
// res
|
||||||
#[cfg(target_os = "ios")]
|
#[cfg(target_os = "ios")]
|
||||||
fn real_args_as_bytes() -> Vec<Vec<u8>> {
|
fn real_args_as_bytes() -> Vec<Vec<u8>> {
|
||||||
|
use ffi::c_str_to_bytes;
|
||||||
use iter::range;
|
use iter::range;
|
||||||
use mem;
|
use mem;
|
||||||
|
|
||||||
|
@ -680,8 +681,7 @@ fn real_args_as_bytes() -> Vec<Vec<u8>> {
|
||||||
let tmp = objc_msgSend(args, objectAtSel, i);
|
let tmp = objc_msgSend(args, objectAtSel, i);
|
||||||
let utf_c_str: *const libc::c_char =
|
let utf_c_str: *const libc::c_char =
|
||||||
mem::transmute(objc_msgSend(tmp, utf8Sel));
|
mem::transmute(objc_msgSend(tmp, utf8Sel));
|
||||||
let s = CString::new(utf_c_str, false);
|
res.push(c_str_to_bytes(&utf_c_str).to_vec());
|
||||||
res.push(s.as_bytes_no_nul().to_vec())
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue