diff options
| author | bors <bors@rust-lang.org> | 2015-01-06 19:47:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-01-06 19:47:08 +0000 |
| commit | ea6f65c5f1a3f84e010d2cef02a0160804e9567a (patch) | |
| tree | be269ae016a0e2b1b606d2303c7050c70a4c7b1a /src/libstd | |
| parent | 6539cb417f4a7c2d9d1afce44c196578d2b67f38 (diff) | |
| parent | 72e08006da9f9bdf73f57a99092aae3109373b93 (diff) | |
| download | rust-ea6f65c5f1a3f84e010d2cef02a0160804e9567a.tar.gz rust-ea6f65c5f1a3f84e010d2cef02a0160804e9567a.zip | |
auto merge of #20633 : vhbit/rust/ios-cstring, r=brson
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/os.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/os.rs b/src/libstd/os.rs index 300ceec4b45..72ad16e0a5d 100644 --- a/src/libstd/os.rs +++ b/src/libstd/os.rs @@ -646,6 +646,7 @@ fn real_args_as_bytes() -> Vec<Vec<u8>> { // res #[cfg(target_os = "ios")] fn real_args_as_bytes() -> Vec<Vec<u8>> { + use ffi::c_str_to_bytes; use iter::range; use mem; @@ -680,8 +681,7 @@ fn real_args_as_bytes() -> Vec<Vec<u8>> { let tmp = objc_msgSend(args, objectAtSel, i); let utf_c_str: *const libc::c_char = mem::transmute(objc_msgSend(tmp, utf8Sel)); - let s = CString::new(utf_c_str, false); - res.push(s.as_bytes_no_nul().to_vec()) + res.push(c_str_to_bytes(&utf_c_str).to_vec()); } } |
