mirror of
https://github.com/RPCS3/rpcs3.git
synced 2024-11-17 08:11:51 +00:00
Minor fix of cellUserInfoGetStat
stat == nullptr is allowed, fix invalid id error code.
This commit is contained in:
parent
be0e586671
commit
ae14eb0747
@ -33,7 +33,8 @@ error_code cellUserInfoGetStat(u32 id, vm::ptr<CellUserInfoUserStat> stat)
|
||||
|
||||
if (id > CELL_SYSUTIL_USERID_MAX)
|
||||
{
|
||||
return CELL_USERINFO_ERROR_NOUSER;
|
||||
// ****** sysutil userinfo parameter error : 1 ******
|
||||
return {CELL_USERINFO_ERROR_PARAM, "1"};
|
||||
}
|
||||
|
||||
if (id == CELL_SYSUTIL_USERID_CURRENT)
|
||||
@ -42,9 +43,6 @@ error_code cellUserInfoGetStat(u32 id, vm::ptr<CellUserInfoUserStat> stat)
|
||||
id = Emu.GetUsrId();
|
||||
}
|
||||
|
||||
if (!stat)
|
||||
return CELL_USERINFO_ERROR_PARAM;
|
||||
|
||||
const std::string& path = vfs::get(fmt::format("/dev_hdd0/home/%08d/", id));
|
||||
|
||||
if (!fs::is_dir(path))
|
||||
@ -61,8 +59,11 @@ error_code cellUserInfoGetStat(u32 id, vm::ptr<CellUserInfoUserStat> stat)
|
||||
return CELL_USERINFO_ERROR_INTERNAL;
|
||||
}
|
||||
|
||||
stat->id = id;
|
||||
strcpy_trunc(stat->name, f.to_string());
|
||||
if (stat)
|
||||
{
|
||||
stat->id = id;
|
||||
strcpy_trunc(stat->name, f.to_string());
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user