diff --git a/ports/cef/wrappers.rs b/ports/cef/wrappers.rs index 29a04e38678..efc8ac8aaae 100644 --- a/ports/cef/wrappers.rs +++ b/ports/cef/wrappers.rs @@ -245,14 +245,14 @@ impl<'a> CefWrap for String { let boxed_string; unsafe { - let buffer = libc::malloc((mem::size_of::() as u64) * - ((utf16_chars.len() + 1) as u64)) as *mut u16; + let buffer = libc::malloc((mem::size_of::() as libc::size_t) * + ((utf16_chars.len() + 1) as libc::size_t)) as *mut u16; for (i, ch) in utf16_chars.iter().enumerate() { *buffer.offset(i as int) = *ch } *buffer.offset(utf16_chars.len() as int) = 0; - boxed_string = libc::malloc(mem::size_of::() as u64) as + boxed_string = libc::malloc(mem::size_of::() as libc::size_t) as *mut cef_string_utf16; ptr::write(&mut (*boxed_string).str, buffer); ptr::write(&mut (*boxed_string).length, utf16_chars.len() as u64);