diff options
author | Haru <haru@dotalux.com> | 2016-04-30 00:11:44 +0200 |
---|---|---|
committer | Haru <haru@dotalux.com> | 2016-04-30 00:11:44 +0200 |
commit | e88ac41acf8d488c2b96771372a34880069e251a (patch) | |
tree | bed4fa20c35bd180498c23586f20883f57b7cba6 /src/char/inter.c | |
parent | 8ac699f4840bdadfb92326250295e1fed8286183 (diff) | |
download | hercules-e88ac41acf8d488c2b96771372a34880069e251a.tar.gz hercules-e88ac41acf8d488c2b96771372a34880069e251a.tar.bz2 hercules-e88ac41acf8d488c2b96771372a34880069e251a.tar.xz hercules-e88ac41acf8d488c2b96771372a34880069e251a.zip |
Corrected truncation of the last letter in whisper messages
- Follow-up to ccfd054
- Fixes #1275
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/char/inter.c')
-rw-r--r-- | src/char/inter.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/char/inter.c b/src/char/inter.c index 9fea2885c..8f7f5c144 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -968,8 +968,8 @@ int mapif_wis_message(struct WisData *wd) //if (wd->len > 2047-56) wd->len = 2047-56; //Force it to fit to avoid crashes. [Skotlex] if (wd->len < 0) wd->len = 0; - if (wd->len >= sizeof(wd->msg) - 1) - wd->len = sizeof(wd->msg) - 1; + if (wd->len >= (int)sizeof(wd->msg) - 1) + wd->len = (int)sizeof(wd->msg) - 1; WBUFW(buf, 0) = 0x3801; WBUFW(buf, 2) = 56 +wd->len; @@ -1172,7 +1172,7 @@ int mapif_parse_WisToGM(int fd) { unsigned char buf[2048]; // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B - memcpy(WBUFP(buf,0), RFIFOP(fd,0), RFIFOW(fd,2)); + memcpy(WBUFP(buf,0), RFIFOP(fd,0), RFIFOW(fd,2)); // Message contains the NUL terminator (see intif_wis_message_to_gm()) WBUFW(buf, 0) = 0x3803; mapif->sendall(buf, RFIFOW(fd,2)); |