From ae14eb07478162a774a8352262f57b0a944745ff Mon Sep 17 00:00:00 2001 From: Eladash Date: Fri, 20 Mar 2020 13:15:28 +0200 Subject: [PATCH] Minor fix of cellUserInfoGetStat stat == nullptr is allowed, fix invalid id error code. --- rpcs3/Emu/Cell/Modules/cellUserInfo.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellUserInfo.cpp b/rpcs3/Emu/Cell/Modules/cellUserInfo.cpp index d2ad711d42..306b7bd597 100644 --- a/rpcs3/Emu/Cell/Modules/cellUserInfo.cpp +++ b/rpcs3/Emu/Cell/Modules/cellUserInfo.cpp @@ -33,7 +33,8 @@ error_code cellUserInfoGetStat(u32 id, vm::ptr 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 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 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; }