diff --git a/Core/Dialog/PSPOskDialog.cpp b/Core/Dialog/PSPOskDialog.cpp index 958f3d2cb7..b87b60bb7d 100755 --- a/Core/Dialog/PSPOskDialog.cpp +++ b/Core/Dialog/PSPOskDialog.cpp @@ -174,11 +174,13 @@ void GetWideStringFromPSPPointer(std::wstring& _string, const PSPPointer auto input = em_address; int c; - u32_le count; + u32_le count = 0; while ((c = *input++) != 0) { if ( !(++count >= maxLength) ) *string++ = c; + else + break; } *string++ = '\0'; _string = stringBuffer;