瀏覽代碼

Follow up to https://github.com/rathena/rathena/commit/bd1b07285b583aba19870ded387a4c99384f5655
* small fixed in variable

icxbb-xx 10 年之前
父節點
當前提交
58c2b773a2
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. 2 3
      src/map/clif.c

+ 2 - 3
src/map/clif.c

@@ -5762,8 +5762,7 @@ void clif_displaymessage(const int fd, const char* mes)
 		/** so we redirect to ZC_NPC_CHAT **/
 		//clif_colormes(fd, color_table[COLOR_DEFAULT], mes);
 		unsigned long color = (color_table[COLOR_DEFAULT] & 0x0000FF) << 16 | (color_table[COLOR_DEFAULT] & 0x00FF00) | (color_table[COLOR_DEFAULT] & 0xFF0000) >> 16; // RGB to BGR
-
-		int len = strnlen(mes, 255);
+		unsigned short len = strnlen(mes, 255);
 
 		if (len > 0) { 
 			WFIFOHEAD(fd, 13 + len);
@@ -5771,7 +5770,7 @@ void clif_displaymessage(const int fd, const char* mes)
 			WFIFOW(fd, 2) = 13 + len;
 			WFIFOL(fd, 4) = 0;
 			WFIFOL(fd, 8) = color;
-			safestrncpy((char*)WFIFOP(fd, 12), mes, len + 1);
+			safestrncpy((char*)WFIFOP(fd, 12), mes, len);
 			WFIFOSET(fd, WFIFOW(fd, 2));
 		}
 #else