mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 17:19:18 +01:00
nn_act: Fix errors in Mii name (#95)
nn_act: Don't swap the Mii name again Account: Zero out miiName before copying in data
This commit is contained in:
parent
ef61361b87
commit
07ce5b0aa6
@ -101,6 +101,7 @@ Account::Account(uint32 persistent_id, std::wstring_view mii_name)
|
|||||||
// set default name
|
// set default name
|
||||||
FFLData_t* fflData = (FFLData_t*)m_mii_data.data();
|
FFLData_t* fflData = (FFLData_t*)m_mii_data.data();
|
||||||
const auto tmp_name = GetMiiName();
|
const auto tmp_name = GetMiiName();
|
||||||
|
memset(fflData->miiName, 0, sizeof(fflData->miiName));
|
||||||
std::copy(tmp_name.cbegin(), tmp_name.cend(), fflData->miiName);
|
std::copy(tmp_name.cbegin(), tmp_name.cend(), fflData->miiName);
|
||||||
|
|
||||||
// calculate checksum
|
// calculate checksum
|
||||||
|
@ -369,7 +369,7 @@ void nnActExport_GetMiiName(PPCInterpreter_t* hCPU)
|
|||||||
sint32 miiNameLength = 0;
|
sint32 miiNameLength = 0;
|
||||||
for (sint32 i = 0; i < MII_FFL_NAME_LENGTH; i++)
|
for (sint32 i = 0; i < MII_FFL_NAME_LENGTH; i++)
|
||||||
{
|
{
|
||||||
miiName[i] = _swapEndianU16(miiData->miiName[i]);
|
miiName[i] = miiData->miiName[i];
|
||||||
if (miiData->miiName[i] == (const uint16be)'\0')
|
if (miiData->miiName[i] == (const uint16be)'\0')
|
||||||
break;
|
break;
|
||||||
miiNameLength = i+1;
|
miiNameLength = i+1;
|
||||||
@ -392,7 +392,7 @@ void nnActExport_GetMiiNameEx(PPCInterpreter_t* hCPU)
|
|||||||
sint32 miiNameLength = 0;
|
sint32 miiNameLength = 0;
|
||||||
for (sint32 i = 0; i < MII_FFL_NAME_LENGTH; i++)
|
for (sint32 i = 0; i < MII_FFL_NAME_LENGTH; i++)
|
||||||
{
|
{
|
||||||
miiName[i] = _swapEndianU16(miiData->miiName[i]);
|
miiName[i] = miiData->miiName[i];
|
||||||
if (miiData->miiName[i] == (const uint16be)'\0')
|
if (miiData->miiName[i] == (const uint16be)'\0')
|
||||||
break;
|
break;
|
||||||
miiNameLength = i + 1;
|
miiNameLength = i + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user