mirror of
https://github.com/servo/servo.git
synced 2025-08-29 17:18:23 +01:00
use enc.len() for cef_string_utf8_to_utf16 conversion size
This commit is contained in:
parent
cb5d7b98bf
commit
62deac9346
1 changed files with 1 additions and 1 deletions
|
@ -98,7 +98,7 @@ pub extern "C" fn cef_string_utf8_to_utf16(src: *const u8, src_len: size_t, outp
|
||||||
unsafe {
|
unsafe {
|
||||||
slice::raw::buf_as_slice(src, src_len as uint, |result| {
|
slice::raw::buf_as_slice(src, src_len as uint, |result| {
|
||||||
let enc = str::from_utf8(result).unwrap().utf16_units().collect::<Vec<u16>>();
|
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
|
1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue