account for null terminator in repetition filter
This commit is contained in:
parent
76804dd0aa
commit
140c9057ea
@ -313,7 +313,7 @@ namespace Util
|
||||
{
|
||||
wchar_t* end = text.data() + text.size();
|
||||
for (int length = text.size() / 3; length > 6; --length)
|
||||
if (wcsncmp(end - length * 3, end - length * 2, length) == 0 && wcsncmp(end - length * 3, end - length * 1, length) == 0)
|
||||
if (memcmp(end - length * 3, end - length * 2, length * sizeof(wchar_t)) == 0 && memcmp(end - length * 3, end - length * 1, length * sizeof(wchar_t)) == 0)
|
||||
return RemoveRepetition(text = std::wstring(end - length, length)), true;
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user