aboutsummaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authorthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-05-17 19:30:02 +0000
committerthilo <thilo@edf5b092-35ff-0310-97b2-ce42778d08ea>2007-05-17 19:30:02 +0000
commit22578e7a7d090426f0f56486023c2614bd0d6248 (patch)
tree340e2d7763fd0b9fb62b1475d4ac17cec1f9f1bd /code
parenta2e7301e6bbaa61f689d89020f419628104e1077 (diff)
downloadioquake3-aero-22578e7a7d090426f0f56486023c2614bd0d6248.tar.gz
ioquake3-aero-22578e7a7d090426f0f56486023c2614bd0d6248.zip
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
Diffstat (limited to 'code')
-rw-r--r--code/botlib/be_ai_chat.c9
1 files changed, 6 insertions, 3 deletions
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;