mirror of
https://github.com/Artikash/Example-Extension.git
synced 2024-11-10 11:35:35 +08:00
skip empty sentence
This commit is contained in:
parent
3f5a07da58
commit
4647a78456
@ -21,6 +21,7 @@ extern "C" __declspec(dllexport) wchar_t* OnNewSentence(wchar_t* sentence, const
|
|||||||
int origLength = sentenceStr.size();
|
int origLength = sentenceStr.size();
|
||||||
if (ProcessSentence(sentenceStr, SentenceInfo{ miscInfo }))
|
if (ProcessSentence(sentenceStr, SentenceInfo{ miscInfo }))
|
||||||
{
|
{
|
||||||
|
if (sentenceStr.empty()) return nullptr;
|
||||||
// No need to worry about freeing this: Textractor does it for you.
|
// No need to worry about freeing this: Textractor does it for you.
|
||||||
wchar_t* newSentence = sentenceStr.size() > origLength ? (wchar_t*)HeapAlloc(GetProcessHeap(), 0, (sentenceStr.size() + 1) * sizeof(wchar_t)) : sentence;
|
wchar_t* newSentence = sentenceStr.size() > origLength ? (wchar_t*)HeapAlloc(GetProcessHeap(), 0, (sentenceStr.size() + 1) * sizeof(wchar_t)) : sentence;
|
||||||
wcscpy_s(newSentence, sentenceStr.size() + 1, sentenceStr.c_str());
|
wcscpy_s(newSentence, sentenceStr.size() + 1, sentenceStr.c_str());
|
||||||
|
Loading…
Reference in New Issue
Block a user