mirror of
https://github.com/DrBeef/ioq3quest.git
synced 2024-11-23 12:32:09 +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)
|
||||
{
|
||||
bot_chatstate_t *cs;
|
||||
bot_consolemessage_t *firstmsg;
|
||||
|
||||
cs = BotChatStateFromHandle(chatstate);
|
||||
if (!cs) return 0;
|
||||
if (cs->firstmessage)
|
||||
if ((firstmsg = cs->firstmessage))
|
||||
{
|
||||
Com_Memcpy(cm, cs->firstmessage, sizeof(bot_consolemessage_t));
|
||||
cm->next = cm->prev = NULL;
|
||||
cm->handle = firstmsg->handle;
|
||||
cm->time = firstmsg->time;
|
||||
cm->type = firstmsg->type;
|
||||
Q_strncpyz(cm->message, firstmsg->message, sizeof(cm->message));
|
||||
return cm->handle;
|
||||
} //end if
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue