summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-06-07 18:46:18 +0300
committerAndrei Karas <akaras@inbox.ru>2018-06-14 19:57:43 +0300
commitbd7e76ca308107223bf27ec20ddcffc1c18e4fa3 (patch)
tree9cee14a593eb6e9804958c38a73f43f845eb27c3
parent751ad89f3bf937ba84c9d121fb70dc4bb44fcf10 (diff)
downloadhercules-bd7e76ca308107223bf27ec20ddcffc1c18e4fa3.tar.gz
hercules-bd7e76ca308107223bf27ec20ddcffc1c18e4fa3.tar.bz2
hercules-bd7e76ca308107223bf27ec20ddcffc1c18e4fa3.tar.xz
hercules-bd7e76ca308107223bf27ec20ddcffc1c18e4fa3.zip
Fix clif_parse_OpenVending with empty items list.
Also add cast to int for packet sizes.
-rw-r--r--src/map/clif.c8
1 files changed, 4 insertions, 4 deletions
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);