mirror of
https://github.com/UberGames/ioef.git
synced 2024-11-28 06:52:35 +00:00
Fix a potential crash bug on 64 bit systems in the botlib library. sizeof(bot_consolemessage_t) is different on 64 bit and 32 bit systems.
This commit is contained in:
parent
7d13d6cd3b
commit
9597d684f9
1 changed files with 6 additions and 3 deletions
|
@ -367,13 +367,16 @@ void BotQueueConsoleMessage(int chatstate, int type, char *message)
|
||||||
int BotNextConsoleMessage(int chatstate, bot_consolemessage_t *cm)
|
int BotNextConsoleMessage(int chatstate, bot_consolemessage_t *cm)
|
||||||
{
|
{
|
||||||
bot_chatstate_t *cs;
|
bot_chatstate_t *cs;
|
||||||
|
bot_consolemessage_t *firstmsg;
|
||||||
|
|
||||||
cs = BotChatStateFromHandle(chatstate);
|
cs = BotChatStateFromHandle(chatstate);
|
||||||
if (!cs) return 0;
|
if (!cs) return 0;
|
||||||
if (cs->firstmessage)
|
if ((firstmsg = cs->firstmessage))
|
||||||
{
|
{
|
||||||
Com_Memcpy(cm, cs->firstmessage, sizeof(bot_consolemessage_t));
|
cm->handle = firstmsg->handle;
|
||||||
cm->next = cm->prev = NULL;
|
cm->time = firstmsg->time;
|
||||||
|
cm->type = firstmsg->type;
|
||||||
|
Q_strncpyz(cm->message, firstmsg->message, sizeof(cm->message));
|
||||||
return cm->handle;
|
return cm->handle;
|
||||||
} //end if
|
} //end if
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in a new issue