Added filter \\n and fix WideStringCharReplacer function

This commit is contained in:
Blu3train 2023-05-21 00:24:13 +02:00
parent 4e61f3bfd2
commit 3543549da2

View File

@ -363,7 +363,7 @@ void WideStringCharReplacer(wchar_t *str, size_t *size, const wchar_t *src, size
curlen = len - (cur - str); curlen = len - (cur - str);
if (curlen == 0) if (curlen == 0)
break; break;
::memmove(cur, cur + srclen, 2 * curlen); ::memmove(cur, cur + srclen -1, 2 * curlen);
} }
*size = len * 2; *size = len * 2;
} }
@ -1453,6 +1453,7 @@ bool KiriKiriZ_msvcFilter(LPVOID data, DWORD *size, HookParam *, BYTE)
return false; return false;
prevText = text; prevText = text;
WideStringCharReplacer(text, len, L"\\n", 2, L' ');
if (cpp_wcsnstr(text, L"%", *len/sizeof(wchar_t))) { if (cpp_wcsnstr(text, L"%", *len/sizeof(wchar_t))) {
WideStringFilterBetween(text, len, L"%", 1, L";", 1); WideStringFilterBetween(text, len, L"%", 1, L";", 1);
} }