string len is num of bytes

This commit is contained in:
rustdesk 2022-01-09 20:56:56 +08:00
parent baccff8f99
commit a0c704f36e

View File

@ -315,13 +315,7 @@ impl Handler {
key_event.set_control_key(k);
} else {
let chr = match evt.name {
Some(ref s) => {
if s.len() == 1 {
s.chars().next().unwrap()
} else {
'\0'
}
}
Some(ref s) => s.chars().next().unwrap_or('\0'),
_ => '\0',
};
if chr != '\0' {