소스 검색

Don't add null if the message is already null-terminated. Fixes #1000

Jittapan Pluemsumran 9 년 전
부모
커밋
e9c9fd65d4
1개의 변경된 파일4개의 추가작업 그리고 1개의 파일을 삭제
  1. 4 1
      src/map/clif.c

+ 4 - 1
src/map/clif.c

@@ -9803,7 +9803,10 @@ static bool clif_process_message(struct map_session_data* sd, int format, char**
 	}
 	}
 
 
 #if PACKETVER >= 20151001
 #if PACKETVER >= 20151001
-	message[messagelen++] = '\0';
+	if (message[messagelen-1] != '\0')
+	{
+		message[messagelen++] = '\0';
+	}
 #endif
 #endif
 
 
 	// the declared length must match real length
 	// the declared length must match real length