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/skill.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/map/skill.c') diff --git a/src/map/skill.c b/src/map/skill.c index 8c548b2bc..8844485fb 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -6757,8 +6757,10 @@ struct skill_unit_group *skill_unitsetting (struct block_list *src, int skillid, ShowFatalError("skill_castend_map: out of memory !\n"); exit(1); } - memcpy(group->valstr,talkie_mes,MESSAGE_SIZE-1); - group->valstr[MESSAGE_SIZE-1] = '\0'; + if (sd) + memcpy(group->valstr,sd->message,MESSAGE_SIZE); + else //Eh... we have to write something here... even though mobs shouldn't use this. [Skotlex] + strcpy(group->valstr, "Boo!"); } //Why redefine local variables when the ones of the function can be reused? [Skotlex] -- cgit v1.2.3-60-g2f50