|
|
|
@ -705,21 +705,21 @@ static INT_PTR CALLBACK CrashDialogFunc(HWND wnd, UINT msg, WPARAM wParam, LPARA
|
|
|
|
|
|
|
|
|
|
/* Add path to crash.log and crash.dmp (if any) to the crash window text */
|
|
|
|
|
size_t len = wcslen(_crash_desc) + 2;
|
|
|
|
|
len += wcslen(convert_to_fs(CrashLogWindows::current->crashlog_filename, filenamebuf, lengthof(filenamebuf), false)) + 2;
|
|
|
|
|
len += wcslen(convert_to_fs(CrashLogWindows::current->crashdump_filename, filenamebuf, lengthof(filenamebuf), false)) + 2;
|
|
|
|
|
len += wcslen(convert_to_fs(CrashLogWindows::current->screenshot_filename, filenamebuf, lengthof(filenamebuf), false)) + 1;
|
|
|
|
|
len += wcslen(convert_to_fs(CrashLogWindows::current->crashlog_filename, filenamebuf, lengthof(filenamebuf))) + 2;
|
|
|
|
|
len += wcslen(convert_to_fs(CrashLogWindows::current->crashdump_filename, filenamebuf, lengthof(filenamebuf))) + 2;
|
|
|
|
|
len += wcslen(convert_to_fs(CrashLogWindows::current->screenshot_filename, filenamebuf, lengthof(filenamebuf))) + 1;
|
|
|
|
|
|
|
|
|
|
wchar_t *text = AllocaM(wchar_t, len);
|
|
|
|
|
int printed = _snwprintf(text, len, _crash_desc, convert_to_fs(CrashLogWindows::current->crashlog_filename, filenamebuf, lengthof(filenamebuf), false));
|
|
|
|
|
int printed = _snwprintf(text, len, _crash_desc, convert_to_fs(CrashLogWindows::current->crashlog_filename, filenamebuf, lengthof(filenamebuf)));
|
|
|
|
|
if (printed < 0 || (size_t)printed > len) {
|
|
|
|
|
MessageBox(wnd, L"Catastrophic failure trying to display crash message. Could not perform text formatting.", L"OpenTTD", MB_ICONERROR);
|
|
|
|
|
return FALSE;
|
|
|
|
|
}
|
|
|
|
|
if (convert_to_fs(CrashLogWindows::current->crashdump_filename, filenamebuf, lengthof(filenamebuf), false)[0] != L'\0') {
|
|
|
|
|
if (convert_to_fs(CrashLogWindows::current->crashdump_filename, filenamebuf, lengthof(filenamebuf))[0] != L'\0') {
|
|
|
|
|
wcscat(text, L"\n");
|
|
|
|
|
wcscat(text, filenamebuf);
|
|
|
|
|
}
|
|
|
|
|
if (convert_to_fs(CrashLogWindows::current->screenshot_filename, filenamebuf, lengthof(filenamebuf), false)[0] != L'\0') {
|
|
|
|
|
if (convert_to_fs(CrashLogWindows::current->screenshot_filename, filenamebuf, lengthof(filenamebuf))[0] != L'\0') {
|
|
|
|
|
wcscat(text, L"\n");
|
|
|
|
|
wcscat(text, filenamebuf);
|
|
|
|
|
}
|
|
|
|
@ -738,7 +738,7 @@ static INT_PTR CALLBACK CrashDialogFunc(HWND wnd, UINT msg, WPARAM wParam, LPARA
|
|
|
|
|
wchar_t filenamebuf[MAX_PATH * 2];
|
|
|
|
|
char filename[MAX_PATH];
|
|
|
|
|
if (CrashLogWindows::current->WriteSavegame(filename, lastof(filename))) {
|
|
|
|
|
convert_to_fs(filename, filenamebuf, lengthof(filenamebuf), false);
|
|
|
|
|
convert_to_fs(filename, filenamebuf, lengthof(filenamebuf));
|
|
|
|
|
size_t len = lengthof(_save_succeeded) + wcslen(filenamebuf) + 1;
|
|
|
|
|
wchar_t *text = AllocaM(wchar_t, len);
|
|
|
|
|
_snwprintf(text, len, _save_succeeded, filenamebuf);
|
|
|
|
|