diff options
author | Alexander Baldeck <alexander@archlinux.org> | 2004-09-27 23:56:41 +0000 |
---|---|---|
committer | Alexander Baldeck <alexander@archlinux.org> | 2004-09-27 23:56:41 +0000 |
commit | 35e94b722411bc6ee371bf1bb4c8281638b3bad6 (patch) | |
tree | 6d4c8c16914175c39bbe47b9860fc963ece9607c /src/game.cpp | |
parent | 3c10e107946c25d497cd4e471b20e0e19facd23b (diff) | |
download | mana-35e94b722411bc6ee371bf1bb4c8281638b3bad6.tar.gz mana-35e94b722411bc6ee371bf1bb4c8281638b3bad6.tar.bz2 mana-35e94b722411bc6ee371bf1bb4c8281638b3bad6.tar.xz mana-35e94b722411bc6ee371bf1bb4c8281638b3bad6.zip |
fix for mapserver segfault (broken pipe for all on screen users)
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/game.cpp b/src/game.cpp index e3c60d35..b4933d1c 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -352,14 +352,14 @@ void do_parse() { free(player_node->speech); player_node->speech = NULL; } - + player_node->speech = (char *)malloc(RFIFOW(2)-4); memset(player_node->speech, '\0', RFIFOW(2)-4); - memcpy(player_node->speech, RFIFOP(4), RFIFOW(2)-5); - + memcpy(player_node->speech, RFIFOP(4), RFIFOW(2)-5); // receive 1 byte less than expected, server might be sending garbage instead of '\0' /-kth5 + player_node->speech_time = SPEECH_TIME; player_node->speech_color = makecol(255, 255, 255); - + if(id==0x008e) chatlog.chat_log(player_node->speech, BY_PLAYER, gui_font); else |