2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 10:37:41 -04:00

Fix for when Python gives us strings that aren't null terminated

This commit is contained in:
2011-06-12 01:15:41 -04:00
parent 99507d9e95
commit 03d1043c81

View File

@ -240,7 +240,7 @@ PYTHON_GLOBAL_METHOD_DEFINITION(PtSendRTChat, args, "Params: fromPlayer,toPlayer
else if (PyUnicode_Check(message))
{
Py_ssize_t size = PyUnicode_GetSize(message);
wchar_t* msg = TRACKED_NEW wchar_t[size];
wchar_t* msg = TRACKED_NEW wchar_t[size + 1]; msg[size] = 0;
PyUnicode_AsWideChar((PyUnicodeObject*)message, msg, size);
UInt32 retval = cyMisc::SendRTChat(*fromPlayer, toPlayerList, msg, msgFlags);
DEL(msg);