cellGame: Add missing nullptr checks

if the param is null pointer, the library simply skips writing into it. also fix the order of writes.
This commit is contained in:
eladash 2018-10-17 21:57:24 +03:00 committed by Ivan
parent 98f2967aac
commit 43b75ccf04
1 changed files with 4 additions and 3 deletions

View File

@ -641,15 +641,16 @@ error_code cellGameCreateGameData(vm::ptr<CellGameSetInitParams> init, vm::ptr<c
return CELL_GAME_ERROR_ACCESS_ERROR; // ???
}
// cellGameContentPermit should then move files in non-temporary location and return their non-temporary displacement
if (tmp_contentInfoPath) strcpy_trunc(*tmp_contentInfoPath, tmp_contentInfo);
if (!fs::create_dir(vfs::get(tmp_usrdir)))
{
cellGame.error("cellGameCreateGameData(): failed to create directory '%s'", tmp_usrdir);
return CELL_GAME_ERROR_ACCESS_ERROR; // ???
}
// cellGameContentPermit should then move files in non-temporary location and return their non-temporary displacement
strcpy_trunc(*tmp_contentInfoPath, tmp_contentInfo);
strcpy_trunc(*tmp_usrdirPath, tmp_usrdir);
if (tmp_usrdirPath) strcpy_trunc(*tmp_usrdirPath, tmp_usrdir);
prm->temp = vfs::get(tmp_contentInfo);
cellGame.success("cellGameCreateGameData(): temporary directory '%s' has been created", tmp_contentInfo);