mirror of
https://github.com/UberGames/ioef.git
synced 2025-01-31 04:50:37 +00:00
round string length for pointer alignment
This commit is contained in:
parent
e121614406
commit
d29dfeeb75
1 changed files with 4 additions and 2 deletions
|
@ -675,6 +675,7 @@ bot_synonymlist_t *BotLoadSynonyms(char *filename)
|
||||||
lastsynonym = NULL;
|
lastsynonym = NULL;
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
|
size_t len;
|
||||||
if (!PC_ExpectTokenString(source, "(") ||
|
if (!PC_ExpectTokenString(source, "(") ||
|
||||||
!PC_ExpectTokenType(source, TT_STRING, 0, &token))
|
!PC_ExpectTokenType(source, TT_STRING, 0, &token))
|
||||||
{
|
{
|
||||||
|
@ -688,13 +689,14 @@ bot_synonymlist_t *BotLoadSynonyms(char *filename)
|
||||||
FreeSource(source);
|
FreeSource(source);
|
||||||
return NULL;
|
return NULL;
|
||||||
} //end if
|
} //end if
|
||||||
size += sizeof(bot_synonym_t) + strlen(token.string) + 1;
|
len = (strlen(token.string) + 1 +sizeof(void*)-1) & ~(sizeof(void*)-1);
|
||||||
|
size += sizeof(bot_synonym_t) + len;
|
||||||
if (pass)
|
if (pass)
|
||||||
{
|
{
|
||||||
synonym = (bot_synonym_t *) ptr;
|
synonym = (bot_synonym_t *) ptr;
|
||||||
ptr += sizeof(bot_synonym_t);
|
ptr += sizeof(bot_synonym_t);
|
||||||
synonym->string = ptr;
|
synonym->string = ptr;
|
||||||
ptr += strlen(token.string) + 1;
|
ptr += len;
|
||||||
strcpy(synonym->string, token.string);
|
strcpy(synonym->string, token.string);
|
||||||
//
|
//
|
||||||
if (lastsynonym) lastsynonym->next = synonym;
|
if (lastsynonym) lastsynonym->next = synonym;
|
||||||
|
|
Loading…
Reference in a new issue