From 50c488f109dd24cf08e135ba941c8faedeac4b94 Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Mon, 17 Sep 2018 19:26:44 -0400 Subject: [PATCH] remove unneeded code --- GUI/host/textthread.cc | 1 - extensions/googletranslate.cpp | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/GUI/host/textthread.cc b/GUI/host/textthread.cc index aee42ef..0ef89f2 100644 --- a/GUI/host/textthread.cc +++ b/GUI/host/textthread.cc @@ -37,7 +37,6 @@ void TextThread::Flush() sentence = std::wstring(converted, MultiByteToWideChar(status & USING_UTF8 ? CP_UTF8 : 932, 0, buffer.data(), buffer.size(), converted, buffer.size())); delete[] converted; } - memset(buffer.data(), 0, buffer.size()); buffer.clear(); } AddSentence(sentence); diff --git a/extensions/googletranslate.cpp b/extensions/googletranslate.cpp index 6a2a316..808fcaa 100644 --- a/extensions/googletranslate.cpp +++ b/extensions/googletranslate.cpp @@ -74,7 +74,7 @@ bool ProcessSentence(std::wstring& sentence, const InfoForExtension* miscInfo) if (buffer[0] == '[') { wchar_t wbuffer[10000] = {}; - MultiByteToWideChar(CP_UTF8, 0, (char*)buffer, -1, wbuffer, 10000); + MultiByteToWideChar(CP_UTF8, 0, buffer, -1, wbuffer, 10000); std::wstring response(wbuffer); std::wregex translationFinder(L"\\[\"(.*?)\",[n\"]"); std::wsmatch results;