1
0
Fork 0

Codechange: No need for Utf8Consume and Utf8Encode, if only ASCII characters are checked.

pull/13960/head
frosch 2025-04-02 16:17:49 +02:00 committed by frosch
parent f06bfc0dad
commit f640daee4c
1 changed files with 7 additions and 7 deletions

View File

@ -494,14 +494,14 @@ static INT_PTR CALLBACK CrashDialogFunc(HWND wnd, UINT msg, WPARAM wParam, LPARA
char *crashlog_dos_nl = reinterpret_cast<char *>(filename_buf + filename_buf_length * filename_count);
/* Convert unix -> dos newlines because the edit box only supports that properly. */
const char *crashlog_unix_nl = crashlog.c_str();
char *p = crashlog_dos_nl;
char32_t c;
while ((c = Utf8Consume(&crashlog_unix_nl))) {
if (c == '\n') p += Utf8Encode(p, '\r');
p += Utf8Encode(p, c);
{
char *p = crashlog_dos_nl;
for (char c : crashlog) {
if (c == '\n') *(p++) = '\r';
*(p++) = c;
}
*p = '\0';
}
*p = '\0';
_snwprintf(
crash_desc_buf,