diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common/hex_util.h | 2 | ||||
-rw-r--r-- | src/core/hle/service/am/applets/applet_software_keyboard.cpp | 6 | ||||
-rw-r--r-- | src/yuzu_cmd/config.cpp | 3 |
3 files changed, 8 insertions, 3 deletions
diff --git a/src/common/hex_util.h b/src/common/hex_util.h index f5f9e45077..5e9b6ef8b5 100644 --- a/src/common/hex_util.h +++ b/src/common/hex_util.h @@ -61,7 +61,7 @@ template <typename ContiguousContainer> return out; } -[[nodiscard]] constexpr std::array<u8, 16> AsArray(const char (&data)[17]) { +[[nodiscard]] constexpr std::array<u8, 16> AsArray(const char (&data)[33]) { return HexStringToArray<16>(data); } 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 673abb7552..c89aa1bbfc 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,8 @@ 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 = utf8_submitted_text.size(); + // Include the null terminator in the buffer size. + const u64 buffer_size = utf8_submitted_text.size() + 1; LOG_DEBUG(Service_AM, "\nBuffer Size: {}\nUTF-8 Submitted Text: {}", buffer_size, utf8_submitted_text); @@ -386,7 +387,8 @@ 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 = current_text.size() * sizeof(char16_t); + // Include the null terminator in the buffer size. + const u64 buffer_size = (current_text.size() + 1) * sizeof(char16_t); LOG_DEBUG(Service_AM, "\nBuffer Size: {}\nUTF-16 Submitted Text: {}", buffer_size, Common::UTF16ToUTF8(current_text)); diff --git a/src/yuzu_cmd/config.cpp b/src/yuzu_cmd/config.cpp index 064ecaafa3..4f14be524c 100644 --- a/src/yuzu_cmd/config.cpp +++ b/src/yuzu_cmd/config.cpp @@ -278,6 +278,9 @@ void Config::ReadValues() { if (Settings::values.players.GetValue()[p].analogs[i].empty()) Settings::values.players.GetValue()[p].analogs[i] = default_param; } + + Settings::values.players.GetValue()[p].connected = + sdl2_config->GetBoolean(group, "connected", false); } ReadSetting("ControlsGeneral", Settings::values.mouse_enabled); |