fix
This commit is contained in:
parent
d114694042
commit
52713a4781
1 changed files with 1 additions and 1 deletions
|
|
@ -128,7 +128,7 @@ fn write(
|
|||
let utf8 = match str::from_utf8(&data[..len]) {
|
||||
Ok(s) => s,
|
||||
Err(ref e) if e.valid_up_to() == 0 => {
|
||||
first_byte_char_width = utf8_char_width(data[0]);
|
||||
let first_byte_char_width = utf8_char_width(data[0]);
|
||||
if first_byte_char_width > 1 && data.len() < first_byte_char_width {
|
||||
incomplete_utf8.bytes[0] = data[0];
|
||||
incomplete_utf8.len = 1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue