Merge pull request #29 from Snapchip/#28

This commit is contained in:
ChaosMarc 2020-11-09 09:29:56 +01:00 committed by GitHub
commit a9ab308da4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -268,7 +268,7 @@ DWORD loadStash(Unit* ptChar, Stash* ptStash, BYTE data[], DWORD startSize, DWOR
// if (strlen((char *)&data[curSize]) > 0xF) // if (strlen((char *)&data[curSize]) > 0xF)
// *(char *)&data[curSize+0xF] = NULL; // *(char *)&data[curSize+0xF] = NULL;
if (strlen((char *)&data[curSize])) if (strlen((char *)&data[curSize]))
ptStash->name = (char*)malloc(strlen((char *)&data[curSize]));//D2AllocMem(PCGame->memoryPool, strlen((char *)&data[curSize]),__FILE__,__LINE__,0); ptStash->name = (char*)malloc(strlen((char *)&data[curSize]) + 1);//D2AllocMem(PCGame->memoryPool, strlen((char *)&data[curSize]),__FILE__,__LINE__,0);
if (ptStash->name) if (ptStash->name)
strcpy(ptStash->name, (char *)&data[curSize]); strcpy(ptStash->name, (char *)&data[curSize]);
curSize += strlen((char *)&data[curSize]) + 1; curSize += strlen((char *)&data[curSize]) + 1;
@ -543,7 +543,7 @@ void renameCurrentStash(Unit* ptChar, char* name)
log_msg("renameCurrentStash 3\n"); log_msg("renameCurrentStash 3\n");
if (len > 0) if (len > 0)
{ {
stash->name = (char *)malloc(len);//D2FogMemAlloc(len,__FILE__,__LINE__,0); stash->name = (char *)malloc(len + 1);//D2FogMemAlloc(len,__FILE__,__LINE__,0);
strcpy(stash->name, name); strcpy(stash->name, name);
} }
else else