summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Baldeck <alexander@archlinux.org>2004-09-27 23:56:41 +0000
committerAlexander Baldeck <alexander@archlinux.org>2004-09-27 23:56:41 +0000
commit35e94b722411bc6ee371bf1bb4c8281638b3bad6 (patch)
tree6d4c8c16914175c39bbe47b9860fc963ece9607c
parent3c10e107946c25d497cd4e471b20e0e19facd23b (diff)
downloadmana-client-35e94b722411bc6ee371bf1bb4c8281638b3bad6.tar.gz
mana-client-35e94b722411bc6ee371bf1bb4c8281638b3bad6.tar.bz2
mana-client-35e94b722411bc6ee371bf1bb4c8281638b3bad6.tar.xz
mana-client-35e94b722411bc6ee371bf1bb4c8281638b3bad6.zip
fix for mapserver segfault (broken pipe for all on screen users)
-rw-r--r--src/game.cpp8
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