Browse Source

Properly handle nul termination in swkbd_message_callback

pull/163/head
Fenrir 10 months ago
parent
commit
c1f0bbd9c6
  1. 2
      ctru-rs/src/applets/swkbd.rs

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

@ -830,8 +830,8 @@ impl SoftwareKeyboard {
if let Some(msg) = retmsg.as_deref() { if let Some(msg) = retmsg.as_deref() {
for (idx, code_unit) in msg for (idx, code_unit) in msg
.encode_utf16() .encode_utf16()
.chain(once(0))
.take(swkbd.callback_msg.len() - 1) .take(swkbd.callback_msg.len() - 1)
.chain(once(0))
.enumerate() .enumerate()
{ {
swkbd.callback_msg[idx] = code_unit; swkbd.callback_msg[idx] = code_unit;

Loading…
Cancel
Save