diff options
author | Alexander Baldeck <alexander@archlinux.org> | 2004-09-28 00:19:02 +0000 |
---|---|---|
committer | Alexander Baldeck <alexander@archlinux.org> | 2004-09-28 00:19:02 +0000 |
commit | aaaaf29c25a41faa9090a1542829ef3cd53840de (patch) | |
tree | d6e4389cdfb5b32de17bd05d0d930f90eca5af4f /src/game.cpp | |
parent | 35e94b722411bc6ee371bf1bb4c8281638b3bad6 (diff) | |
download | mana-aaaaf29c25a41faa9090a1542829ef3cd53840de.tar.gz mana-aaaaf29c25a41faa9090a1542829ef3cd53840de.tar.bz2 mana-aaaaf29c25a41faa9090a1542829ef3cd53840de.tar.xz mana-aaaaf29c25a41faa9090a1542829ef3cd53840de.zip |
fix for mapserver segfault (broken pipe for all on screen users)
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game.cpp b/src/game.cpp index b4933d1c..90aac57b 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -329,8 +329,8 @@ void do_parse() { switch(id) { // Received speech case 0x008d: - temp = (char *)malloc(RFIFOW(2)-8); - memset(temp, '\0', RFIFOW(2)-8); + temp = (char *)malloc(RFIFOW(2)-7); + memset(temp, '\0', RFIFOW(2)-7); memcpy(temp, RFIFOP(8), RFIFOW(2)-8); node = find_node(RFIFOL(4)); if(node!=NULL) { @@ -353,9 +353,9 @@ void do_parse() { 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); // receive 1 byte less than expected, server might be sending garbage instead of '\0' /-kth5 + player_node->speech = (char *)malloc(RFIFOW(2)-3); + memset(player_node->speech, '\0', RFIFOW(2)-3); + memcpy(player_node->speech, RFIFOP(4), RFIFOW(2)-4); // 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); |