fix crash
This commit is contained in:
parent
3df68a6c2c
commit
1dfaa759b9
@ -25,6 +25,7 @@ bool RemoveRepeatedChars(std::wstring& sentence)
|
|||||||
|
|
||||||
bool RemoveCyclicRepeats(std::wstring& sentence)
|
bool RemoveCyclicRepeats(std::wstring& sentence)
|
||||||
{
|
{
|
||||||
|
if (sentence == L"") throw std::exception();
|
||||||
int junkLength = 0;
|
int junkLength = 0;
|
||||||
wchar_t junk[2000] = {};
|
wchar_t junk[2000] = {};
|
||||||
while (wcsstr(sentence.c_str() + junkLength, junk))
|
while (wcsstr(sentence.c_str() + junkLength, junk))
|
||||||
|
Loading…
Reference in New Issue
Block a user