Browse Source

Fix off-by-one error in swkbd_message_callback

pull/157/head
Fenrir 10 months ago
parent
commit
f527623405
  1. 6
      ctru-rs/src/applets/swkbd.rs

6
ctru-rs/src/applets/swkbd.rs

@ -890,7 +890,11 @@ impl SoftwareKeyboard {
let callback_msg = &mut swkbd.callback_msg; let callback_msg = &mut swkbd.callback_msg;
if swkbd.callback_result > SWKBD_CALLBACK_OK as _ { if swkbd.callback_result > SWKBD_CALLBACK_OK as _ {
for (idx, ch) in retmsg.encode_utf16().take(callback_msg.len()).enumerate() { for (idx, ch) in retmsg
.encode_utf16()
.take(callback_msg.len() - 1)
.enumerate()
{
callback_msg[idx] = ch; callback_msg[idx] = ch;
} }
} else { } else {

Loading…
Cancel
Save