From 665c5b3eeadea9db3e264b385fb33e0033a1e649 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sat, 22 Sep 2018 03:17:52 -0400 Subject: [PATCH] bugfixes --- GUI/host/textthread.cc | 11 +++++++++-- extensions/extensions.h | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) 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)