diff --git a/GUI/host/textthread.cc b/GUI/host/textthread.cc index a36bdd3..6d17de3 100644 --- a/GUI/host/textthread.cc +++ b/GUI/host/textthread.cc @@ -28,8 +28,15 @@ void TextThread::Flush() { LOCK(ttMutex); if (buffer.size() < 400 && (GetTickCount() - timestamp < FlushDelay || buffer.size() == 0)) return; - if (status & USING_UNICODE) sentence = std::wstring((wchar_t*)buffer.data(), buffer.size() / 2); - else sentence = ToWString(buffer.data(), status & USING_UTF8 ? CP_UTF8 : SHIFT_JIS); + if (status & USING_UNICODE) + { + sentence = std::wstring((wchar_t*)buffer.data(), buffer.size() / 2); + } + else + { + buffer.push_back(0); // Null terminate + sentence = ToWString(buffer.data(), status & USING_UTF8 ? CP_UTF8 : SHIFT_JIS); + } buffer.clear(); } AddSentence(sentence); diff --git a/extensions/extensions.h b/extensions/extensions.h index 2951e57..a05dc54 100644 --- a/extensions/extensions.h +++ b/extensions/extensions.h @@ -13,7 +13,7 @@ struct InfoForExtension }; // Traverses linked list to find info. -int GetProperty(const char* propertyName, const InfoForExtension* miscInfo) +int54_t GetProperty(const char* propertyName, const InfoForExtension* miscInfo) { const InfoForExtension* miscInfoTraverser = miscInfo; while (miscInfoTraverser != nullptr)