From bd7e76ca308107223bf27ec20ddcffc1c18e4fa3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 7 Jun 2018 18:46:18 +0300 Subject: Fix clif_parse_OpenVending with empty items list. Also add cast to int for packet sizes. --- src/map/clif.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/map/clif.c b/src/map/clif.c index 8297bb70b..31cb30078 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -11081,7 +11081,7 @@ void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd) __attribute_ /// 1 = public void clif_parse_CreateChatRoom(int fd, struct map_session_data* sd) { - int len = RFIFOW(fd,2)-15; + int len = (int)RFIFOW(fd, 2) - 15; int limit; bool pub; const char *password; //not zero-terminated @@ -11137,7 +11137,7 @@ void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data* sd) __attr /// 1 = public void clif_parse_ChatRoomStatusChange(int fd, struct map_session_data* sd) { - int len = RFIFOW(fd,2)-15; + int len = (int)RFIFOW(fd, 2) - 15; int limit; bool pub; const char *password; // not zero-terminated @@ -13148,12 +13148,12 @@ void clif_parse_OpenVending(int fd, struct map_session_data* sd) __attribute__(( /// 0 = canceled /// 1 = open void clif_parse_OpenVending(int fd, struct map_session_data* sd) { - short len = (short)RFIFOW(fd,2) - 85; + int len = (int)RFIFOW(fd, 2) - 85; const char *message; bool flag; const uint8 *data; - if (len < 1) + if (len < 0) return; message = RFIFOP(fd,4); -- cgit v1.2.3-60-g2f50