From f9c1b15bf46e371d78b45e1552674330c444b32e Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sat, 12 Jan 2019 09:23:43 +0100 Subject: [PATCH] cellOskDialog: fix cellOskDialogUnloadAsync return string fixes Class of Heroes 2G --- rpcs3/Emu/Cell/Modules/cellOskDialog.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp b/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp index 1c275fe361..ff3e5ee320 100644 --- a/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp +++ b/rpcs3/Emu/Cell/Modules/cellOskDialog.cpp @@ -224,14 +224,18 @@ error_code getText(vm::ptr OutputInfo, bool is } } - const bool is_valid = OutputInfo->pResultString && (OutputInfo->result == CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK || (is_unload && OutputInfo->result == CELL_OSKDIALOG_INPUT_FIELD_RESULT_NO_INPUT_TEXT)); + bool do_copy = OutputInfo->pResultString && (OutputInfo->result == CELL_OSKDIALOG_INPUT_FIELD_RESULT_OK || (is_unload && OutputInfo->result == CELL_OSKDIALOG_INPUT_FIELD_RESULT_NO_INPUT_TEXT)); for (u32 i = 0; i < CELL_OSKDIALOG_STRING_SIZE - 1; i++) { osk->osk_text_old[i] = osk->osk_text[i]; - if (is_valid && i < OutputInfo->numCharsResultString) + if (do_copy && i < OutputInfo->numCharsResultString) { + if (osk->osk_text[i] == 0) + { + do_copy = false; + } OutputInfo->pResultString[i] = osk->osk_text[i]; } } @@ -443,6 +447,11 @@ error_code cellOskDialogExtRegisterConfirmWordFilterCallback(vm::ptr(); if (!osk) {