|
@@ -5762,8 +5762,7 @@ void clif_displaymessage(const int fd, const char* mes)
|
|
/** so we redirect to ZC_NPC_CHAT **/
|
|
/** so we redirect to ZC_NPC_CHAT **/
|
|
//clif_colormes(fd, color_table[COLOR_DEFAULT], mes);
|
|
//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
|
|
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) {
|
|
if (len > 0) {
|
|
WFIFOHEAD(fd, 13 + len);
|
|
WFIFOHEAD(fd, 13 + len);
|
|
@@ -5771,7 +5770,7 @@ void clif_displaymessage(const int fd, const char* mes)
|
|
WFIFOW(fd, 2) = 13 + len;
|
|
WFIFOW(fd, 2) = 13 + len;
|
|
WFIFOL(fd, 4) = 0;
|
|
WFIFOL(fd, 4) = 0;
|
|
WFIFOL(fd, 8) = color;
|
|
WFIFOL(fd, 8) = color;
|
|
- safestrncpy((char*)WFIFOP(fd, 12), mes, len + 1);
|
|
|
|
|
|
+ safestrncpy((char*)WFIFOP(fd, 12), mes, len);
|
|
WFIFOSET(fd, WFIFOW(fd, 2));
|
|
WFIFOSET(fd, WFIFOW(fd, 2));
|
|
}
|
|
}
|
|
#else
|
|
#else
|