summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-04-20 17:06:18 +0200
committerHaru <haru@dotalux.com>2016-04-23 19:09:33 +0200
commitd7ffa6adbcf4800821fe3f961513952450d06f98 (patch)
treef6565bf5ae7e0d2d46a42dc734c83b9adb7b6abe /src/map/clif.c
parente4feddf5198f1c9d45a6c34a95b251df773ab6db (diff)
downloadhercules-d7ffa6adbcf4800821fe3f961513952450d06f98.tar.gz
hercules-d7ffa6adbcf4800821fe3f961513952450d06f98.tar.bz2
hercules-d7ffa6adbcf4800821fe3f961513952450d06f98.tar.xz
hercules-d7ffa6adbcf4800821fe3f961513952450d06f98.zip
Removed the 'len' argument from clif_disp_onlyself() and clif->disp_message()
- The argument was redundant, since the passed value is always the same as the passed string's length (it doesn't make sense otherwise). The argument is implicit now. Less typing and less errors. Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 11d6076e9..1d749b8cf 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -7949,19 +7949,21 @@ void clif_marriage_proposal(int fd, struct map_session_data *sd, struct map_sess
/*==========================================
* Displays a message using the guild-chat colors to the specified targets. [Skotlex]
*------------------------------------------*/
-void clif_disp_message(struct block_list* src, const char* mes, size_t len, enum send_target target)
+void clif_disp_message(struct block_list *src, const char *mes, enum send_target target)
{
unsigned char buf[256];
+ int len;
+ nullpo_retv(mes);
+ nullpo_retv(src);
+
+ len = (int)strlen(mes);
if (len == 0)
return;
- nullpo_retv(src);
- nullpo_retv(mes);
-
- if (len > sizeof(buf)-5) {
- ShowWarning("clif_disp_message: Truncated message '%s' (len=%"PRIuS", max=%"PRIuS", aid=%d).\n", mes, len, sizeof(buf)-5, src->id);
- len = sizeof(buf)-5;
+ if (len > (int)sizeof(buf)-5) {
+ ShowWarning("clif_disp_message: Truncated message '%s' (len=%d, max=%"PRIuS", aid=%d).\n", mes, len, sizeof(buf)-5, src->id);
+ len = (int)sizeof(buf)-5;
}
WBUFW(buf, 0) = 0x17f;
@@ -10738,10 +10740,10 @@ void clif_noask_sub(struct map_session_data *src, struct map_session_data *targe
nullpo_retv(src);
// Your request has been rejected by autoreject option.
msg = msg_sd(src,392);
- clif_disp_onlyself(src, msg, strlen(msg));
+ clif_disp_onlyself(src, msg);
//Notice that a request was rejected.
snprintf(output, 256, msg_sd(target,393+type), src->status.name, 256);
- clif_disp_onlyself(target, output, strlen(output));
+ clif_disp_onlyself(target, output);
}
void clif_parse_TradeRequest(int fd,struct map_session_data *sd) __attribute__((nonnull (2)));
@@ -14659,7 +14661,7 @@ void clif_Mail_refreshinbox(struct map_session_data *sd)
if( md->full ) {// TODO: is this official?
char output[100];
sprintf(output, "Inbox is full (Max %d). Delete some mails.", MAIL_MAX_INBOX);
- clif_disp_onlyself(sd, output, strlen(output));
+ clif_disp_onlyself(sd, output);
}
}