We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 72688ea commit aababbbCopy full SHA for aababbb
src/libstd/c_str.rs
@@ -124,7 +124,7 @@ impl<'self> ToCStr for &'self [u8] {
124
fn to_c_str(&self) -> CString {
125
do self.as_imm_buf |self_buf, self_len| {
126
unsafe {
127
- 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;
128
if buf.is_null() {
129
fail!("failed to allocate memory!");
130
}
0 commit comments