diff options
author | bunnei <bunneidev@gmail.com> | 2021-07-30 18:26:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-30 18:26:35 +0200 |
commit | 0334b9b7761cc2fea0e96297d3f2afcce46a5804 (patch) | |
tree | 9fa893c5a153613862ae4843fd738833076defeb /src/core/hle/service/am/applets/applet_software_keyboard.cpp | |
parent | Merge pull request #6767 from ReinUsesLisp/fold-float-pack (diff) | |
parent | applet_swkbd: Correct string buffer size calculation (diff) | |
download | yuzu-0334b9b7761cc2fea0e96297d3f2afcce46a5804.tar yuzu-0334b9b7761cc2fea0e96297d3f2afcce46a5804.tar.gz yuzu-0334b9b7761cc2fea0e96297d3f2afcce46a5804.tar.bz2 yuzu-0334b9b7761cc2fea0e96297d3f2afcce46a5804.tar.lz yuzu-0334b9b7761cc2fea0e96297d3f2afcce46a5804.tar.xz yuzu-0334b9b7761cc2fea0e96297d3f2afcce46a5804.tar.zst yuzu-0334b9b7761cc2fea0e96297d3f2afcce46a5804.zip |
Diffstat (limited to '')
-rw-r--r-- | src/core/hle/service/am/applets/applet_software_keyboard.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/hle/service/am/applets/applet_software_keyboard.cpp b/src/core/hle/service/am/applets/applet_software_keyboard.cpp index 7cae90609..673abb755 100644 --- a/src/core/hle/service/am/applets/applet_software_keyboard.cpp +++ b/src/core/hle/service/am/applets/applet_software_keyboard.cpp @@ -377,7 +377,7 @@ void SoftwareKeyboard::SubmitForTextCheck(std::u16string submitted_text) { if (swkbd_config_common.use_utf8) { std::string utf8_submitted_text = Common::UTF16ToUTF8(current_text); - const u64 buffer_size = sizeof(u64) + utf8_submitted_text.size(); + const u64 buffer_size = utf8_submitted_text.size(); LOG_DEBUG(Service_AM, "\nBuffer Size: {}\nUTF-8 Submitted Text: {}", buffer_size, utf8_submitted_text); @@ -386,7 +386,7 @@ void SoftwareKeyboard::SubmitForTextCheck(std::u16string submitted_text) { std::memcpy(out_data.data() + sizeof(u64), utf8_submitted_text.data(), utf8_submitted_text.size()); } else { - const u64 buffer_size = sizeof(u64) + current_text.size() * sizeof(char16_t); + const u64 buffer_size = current_text.size() * sizeof(char16_t); LOG_DEBUG(Service_AM, "\nBuffer Size: {}\nUTF-16 Submitted Text: {}", buffer_size, Common::UTF16ToUTF8(current_text)); |