Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
Artikash committed Jan 31, 2021
1 parent 4494691 commit ea46617
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ExampleExtension/ExtensionImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ extern "C" __declspec(dllexport) wchar_t* OnNewSentence(wchar_t* sentence, const
{
try
{
std::wstring sentenceStr(sentence);
int origLength = sentenceStr.size();
if (ProcessSentence(sentenceStr, SentenceInfo{ sentenceInfo }))
std::wstring sentenceCopy(sentence);
int oldSize = sentenceCopy.size();
if (ProcessSentence(sentenceCopy, SentenceInfo{ sentenceInfo }))
{
if (sentenceStr.size() > origLength) sentence = (wchar_t*)HeapReAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, sentence, (sentenceStr.size() + 1) * sizeof(wchar_t));
wcscpy_s(sentence, sentenceStr.size() + 1, sentenceStr.c_str());
if (sentenceCopy.size() > oldSize) sentence = (wchar_t*)HeapReAlloc(GetProcessHeap(), HEAP_GENERATE_EXCEPTIONS, sentence, (sentenceCopy.size() + 1) * sizeof(wchar_t));
wcscpy_s(sentence, sentenceCopy.size() + 1, sentenceCopy.c_str());
}
}
catch (SKIP)
Expand Down

0 comments on commit ea46617

Please sign in to comment.