From aababbba8e5d5b56aa4a0cedb9b2008ba6cdc422 Mon Sep 17 00:00:00 2001 From: Erick Tryzelaar Date: Tue, 6 Aug 2013 21:19:38 -0700 Subject: [PATCH] std: fix a bad type cast for in str.to_c_str() --- src/libstd/c_str.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/c_str.rs b/src/libstd/c_str.rs index ac9bbfb1dfb..7e313543660 100644 --- a/src/libstd/c_str.rs +++ b/src/libstd/c_str.rs @@ -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!"); } -- GitLab