mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
CreateSema: Truncate and validate like the PSP.
This commit is contained in:
parent
0ab19c18e5
commit
dd14450424
1 changed files with 5 additions and 1 deletions
|
@ -120,11 +120,15 @@ void sceKernelCancelSema(SceUID id, int newCount, u32 numWaitThreadsPtr)
|
|||
//SceUID sceKernelCreateSema(const char *name, SceUInt attr, int initVal, int maxVal, SceKernelSemaOptParam *option);
|
||||
SceUID sceKernelCreateSema(const char* name, u32 attr, int initVal, int maxVal, u32 optionPtr)
|
||||
{
|
||||
if (!name)
|
||||
return SCE_KERNEL_ERROR_ERROR;
|
||||
|
||||
Semaphore *s = new Semaphore;
|
||||
SceUID id = kernelObjects.Create(s);
|
||||
|
||||
s->ns.size = sizeof(NativeSemaphore);
|
||||
strncpy(s->ns.name, name, 32);
|
||||
strncpy(s->ns.name, name, 31);
|
||||
s->ns.name[31] = 0;
|
||||
s->ns.attr = attr;
|
||||
s->ns.initCount = initVal;
|
||||
s->ns.currentCount = s->ns.initCount;
|
||||
|
|
Loading…
Add table
Reference in a new issue