mirror of https://github.com/OpenTTD/OpenTTD
Codechange: No need for Utf8Consume and Utf8Encode, if only ASCII characters are checked.
parent
f06bfc0dad
commit
f640daee4c
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue