From 22578e7a7d090426f0f56486023c2614bd0d6248 Mon Sep 17 00:00:00 2001 From: thilo Date: Thu, 17 May 2007 19:30:02 +0000 Subject: 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. git-svn-id: svn://svn.icculus.org/quake3/trunk@1084 edf5b092-35ff-0310-97b2-ce42778d08ea --- code/botlib/be_ai_chat.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'code') diff --git a/code/botlib/be_ai_chat.c b/code/botlib/be_ai_chat.c index d61e11e..7df59e9 100644 --- a/code/botlib/be_ai_chat.c +++ b/code/botlib/be_ai_chat.c @@ -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; -- cgit v1.2.3