Minor fix of cellUserInfoGetStat
stat == nullptr is allowed, fix invalid id error code.
This commit is contained in:
@@ -33,7 +33,8 @@ error_code cellUserInfoGetStat(u32 id, vm::ptr<CellUserInfoUserStat> stat)
|
|||||||
|
|
||||||
if (id > CELL_SYSUTIL_USERID_MAX)
|
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)
|
if (id == CELL_SYSUTIL_USERID_CURRENT)
|
||||||
@@ -42,9 +43,6 @@ error_code cellUserInfoGetStat(u32 id, vm::ptr<CellUserInfoUserStat> stat)
|
|||||||
id = Emu.GetUsrId();
|
id = Emu.GetUsrId();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!stat)
|
|
||||||
return CELL_USERINFO_ERROR_PARAM;
|
|
||||||
|
|
||||||
const std::string& path = vfs::get(fmt::format("/dev_hdd0/home/%08d/", id));
|
const std::string& path = vfs::get(fmt::format("/dev_hdd0/home/%08d/", id));
|
||||||
|
|
||||||
if (!fs::is_dir(path))
|
if (!fs::is_dir(path))
|
||||||
@@ -61,8 +59,11 @@ error_code cellUserInfoGetStat(u32 id, vm::ptr<CellUserInfoUserStat> stat)
|
|||||||
return CELL_USERINFO_ERROR_INTERNAL;
|
return CELL_USERINFO_ERROR_INTERNAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (stat)
|
||||||
|
{
|
||||||
stat->id = id;
|
stat->id = id;
|
||||||
strcpy_trunc(stat->name, f.to_string());
|
strcpy_trunc(stat->name, f.to_string());
|
||||||
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user