From d2f88f0450a23f8b9cd9579451059acb08f14f52 Mon Sep 17 00:00:00 2001 From: skotlex Date: Fri, 2 Feb 2007 19:59:39 +0000 Subject: - The define MESSAGE_SIZE was wrong! It is only used for input boxes. Therefore now it is only used for Vending, Talkie box and Graffiti - Added new define CHAT_SIZE which holds the max length that a client can send from the chat buffer. This value is NAME_LENGTH + 3 (the ' : ') + 70 (the actual text). - Added define msg_len_check which crops incoming client text if it's longer than CHAT_SIZE. Added cropping to all incoming messages except normal chatting which is already accounted for. - Removed variable talkie_mes, this is now handled by sd->message - Cleaned up parser functions for /b /lb, gm kick, /shift, /recall - Added crash protection to the logging functions when they receive a too long string. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9778 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/atcommand.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/map/atcommand.c') diff --git a/src/map/atcommand.c b/src/map/atcommand.c index d11b898e8..76dfdd879 100644 --- a/src/map/atcommand.c +++ b/src/map/atcommand.c @@ -1030,15 +1030,15 @@ int atcommand_config_read(const char *cfgName) */ int atcommand_commands(const int fd, struct map_session_data* sd, const char* command, const char* message) { - char cz_line_buff[MESSAGE_SIZE+1]; + char cz_line_buff[CHAT_SIZE+1]; register char *lpcz_cur = cz_line_buff; register unsigned int ui_slen; int i_cur_cmd,gm_lvl = pc_isGM(sd), count = 0; - memset(cz_line_buff,' ',MESSAGE_SIZE); - cz_line_buff[MESSAGE_SIZE] = 0; + memset(cz_line_buff,' ',CHAT_SIZE); + cz_line_buff[CHAT_SIZE] = 0; clif_displaymessage(fd, msg_txt(273)); @@ -1050,13 +1050,13 @@ int atcommand_commands(const int fd, struct map_session_data* sd, const char* co count++; ui_slen = (unsigned int)strlen(atcommand_info[i_cur_cmd].command); - //rember not <= bc we need null terminator - if(((MESSAGE_SIZE+(int)cz_line_buff)-(int)lpcz_cur) < (int)ui_slen) + //remember not <= bc we need null terminator + if(((CHAT_SIZE+(int)cz_line_buff)-(int)lpcz_cur) < (int)ui_slen) { clif_displaymessage(fd,(char*)cz_line_buff); lpcz_cur = cz_line_buff; - memset(cz_line_buff,' ',MESSAGE_SIZE); - cz_line_buff[MESSAGE_SIZE] = 0; + memset(cz_line_buff,' ',CHAT_SIZE); + cz_line_buff[CHAT_SIZE] = 0; } memcpy(lpcz_cur,atcommand_info[i_cur_cmd].command,ui_slen); -- cgit v1.2.3-70-g09d2