summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 1d749b8cf..d6a418a47 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -11978,7 +11978,7 @@ void clif_parse_PartyMessage(int fd, struct map_session_data *sd)
if (clif->process_chat_message(sd, packet, message, sizeof message) == NULL)
return;
- party->send_message(sd, message, (int)strlen(message));
+ party->send_message(sd, message);
}
void clif_parse_PartyChangeLeader(int fd, struct map_session_data* sd) __attribute__((nonnull (2)));
@@ -13077,9 +13077,9 @@ void clif_parse_GuildMessage(int fd, struct map_session_data *sd)
return;
if (sd->bg_id)
- bg->send_message(sd, message, (int)strlen(message));
+ bg->send_message(sd, message);
else
- guild->send_message(sd, message, (int)strlen(message));
+ guild->send_message(sd, message);
}
void clif_parse_GuildRequestAlliance(int fd, struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -16143,17 +16143,21 @@ void clif_bg_xy_remove(struct map_session_data *sd)
/// Notifies clients of a battleground message (ZC_BATTLEFIELD_CHAT).
/// 02dc <packet len>.W <account id>.L <name>.24B <message>.?B
-void clif_bg_message(struct battleground_data *bgd, int src_id, const char *name, const char *mes, size_t len)
+void clif_bg_message(struct battleground_data *bgd, int src_id, const char *name, const char *mes)
{
struct map_session_data *sd;
unsigned char *buf;
+ int len;
nullpo_retv(bgd);
nullpo_retv(name);
nullpo_retv(mes);
- if( !bgd->count || (sd = bg->getavailablesd(bgd)) == NULL )
+
+ if (!bgd->count || (sd = bg->getavailablesd(bgd)) == NULL)
return;
+ len = (int)strlen(mes);
+ Assert_retv(len <= INT16_MAX - NAME_LENGTH - 8);
buf = (unsigned char*)aMalloc((len + NAME_LENGTH + 8)*sizeof(unsigned char));
WBUFW(buf,0) = 0x2dc;
@@ -16185,7 +16189,7 @@ void clif_parse_BattleChat(int fd, struct map_session_data *sd)
if (clif->process_chat_message(sd, packet, message, sizeof message) == NULL)
return;
- bg->send_message(sd, message, (int)strlen(message));
+ bg->send_message(sd, message);
}
/// Notifies client of a battleground score change (ZC_BATTLEFIELD_NOTIFY_POINT).