Pārlūkot izejas kodu

- Fixed crash on the NPC whisper system when the message's size was 1.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5452 54d463be-8e91-2dee-dedb-b68131a5f0ec
skotlex 19 gadi atpakaļ
vecāks
revīzija
389c773fd2
2 mainītis faili ar 4 papildinājumiem un 2 dzēšanām
  1. 2 0
      Changelog-Trunk.txt
  2. 2 2
      src/map/clif.c

+ 2 - 0
Changelog-Trunk.txt

@@ -5,6 +5,8 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.  EV
 GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
 
 2006/03/03
+	* Fixed crash on the NPC whisper system when the message's size was 1.
+	  [Skotlex]
 	* Strip status changes are now removed on logout. [Skotlex]
 	* Added a column in skill_cast_db for specifying can't walk delays. It's
 	  all set to 0 currently, so someone get updating them! [Skotlex]

+ 2 - 2
src/map/clif.c

@@ -9456,10 +9456,10 @@ void clif_parse_Wis(int fd, struct map_session_data *sd) { // S 0096 <len>.w <ni
 //   Lordalfa - Paperboy - To whisper NPC commands       //
 //-------------------------------------------------------//
 if ((strncasecmp((const char*)RFIFOP(fd,4),"NPC:",4) == 0) && (strlen((const char*)RFIFOP(fd,4)) >4))   {
-		whisper_tmp = (char*) RFIFOP(fd,4) + 4;
+	whisper_tmp = (char*) RFIFOP(fd,4) + 4;
     if ((npc = npc_name2id(whisper_tmp)))	
 	{
-		whisper_tmp=(char *)aCallocA(strlen((char *)(RFIFOP(fd,28))+1),sizeof(char));
+		whisper_tmp=(char *)aCallocA(strlen((char *)(RFIFOP(fd,28)))+1,sizeof(char));
 		whisper_tmp[0]=0;
 	   
 		sprintf(whisper_tmp, "%s", (const char*)RFIFOP(fd,28));