提交 aababbba 编写于 作者: E Erick Tryzelaar

std: fix a bad type cast for in str.to_c_str()

上级 72688eaa
......@@ -124,7 +124,7 @@ impl<'self> ToCStr for &'self [u8] {
fn to_c_str(&self) -> CString {
do self.as_imm_buf |self_buf, self_len| {
unsafe {
let buf = libc::malloc(self_len as u64 + 1) as *mut u8;
let buf = libc::malloc(self_len as libc::size_t + 1) as *mut u8;
if buf.is_null() {
fail!("failed to allocate memory!");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册