mirror of
https://github.com/RPCS3/rpcs3.git
synced 2026-06-03 21:25:04 -06:00
cellSysUtil: Add a few CELL_SYSUTIL_ERROR_VALUE checks
This commit is contained in:
parent
894658f14c
commit
da12969898
@ -203,6 +203,11 @@ error_code cellSysutilGetSystemParamInt(CellSysutilParamId id, vm::ptr<s32> valu
|
|||||||
{
|
{
|
||||||
cellSysutil.warning("cellSysutilGetSystemParamInt(id=0x%x(%s), value=*0x%x)", id, id, value);
|
cellSysutil.warning("cellSysutilGetSystemParamInt(id=0x%x(%s), value=*0x%x)", id, id, value);
|
||||||
|
|
||||||
|
if (!value)
|
||||||
|
{
|
||||||
|
return CELL_SYSUTIL_ERROR_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: load this information from config (preferably "sys/" group)
|
// TODO: load this information from config (preferably "sys/" group)
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
@ -272,7 +277,7 @@ error_code cellSysutilGetSystemParamInt(CellSysutilParamId id, vm::ptr<s32> valu
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return CELL_EINVAL;
|
return CELL_SYSUTIL_ERROR_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
@ -282,6 +287,11 @@ error_code cellSysutilGetSystemParamString(CellSysutilParamId id, vm::ptr<char>
|
|||||||
{
|
{
|
||||||
cellSysutil.trace("cellSysutilGetSystemParamString(id=0x%x(%s), buf=*0x%x, bufsize=%d)", id, id, buf, bufsize);
|
cellSysutil.trace("cellSysutilGetSystemParamString(id=0x%x(%s), buf=*0x%x, bufsize=%d)", id, id, buf, bufsize);
|
||||||
|
|
||||||
|
if (!buf)
|
||||||
|
{
|
||||||
|
return CELL_SYSUTIL_ERROR_VALUE;
|
||||||
|
}
|
||||||
|
|
||||||
memset(buf.get_ptr(), 0, bufsize);
|
memset(buf.get_ptr(), 0, bufsize);
|
||||||
|
|
||||||
switch (id)
|
switch (id)
|
||||||
@ -295,7 +305,7 @@ error_code cellSysutilGetSystemParamString(CellSysutilParamId id, vm::ptr<char>
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return CELL_EINVAL;
|
return CELL_SYSUTIL_ERROR_VALUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user