Skip to content

Commit

Permalink
use enc.len() for cef_string_utf8_to_utf16 conversion size
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Blumenkrantz committed Oct 13, 2014
1 parent cb5d7b9 commit 62deac9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ports/cef/string.rs
Expand Up @@ -98,7 +98,7 @@ pub extern "C" fn cef_string_utf8_to_utf16(src: *const u8, src_len: size_t, outp
unsafe {
slice::raw::buf_as_slice(src, src_len as uint, |result| {
let enc = str::from_utf8(result).unwrap().utf16_units().collect::<Vec<u16>>();
cef_string_utf16_set(enc.as_ptr(), (src_len * 2) as size_t, output, 1);
cef_string_utf16_set(enc.as_ptr(), enc.len() as size_t, output, 1);
});
}
1
Expand Down

0 comments on commit 62deac9

Please sign in to comment.