Fixed the fourth batch of problems.

This commit is contained in:
OBattler
2020-01-15 05:24:33 +01:00
parent 932ad5595a
commit e44e60c660
19 changed files with 91 additions and 50 deletions

View File

@@ -1077,9 +1077,12 @@ wchar_t *
ui_window_title(wchar_t *s)
{
if (! video_fullscreen) {
if (s != NULL)
wcscpy(wTitle, s);
else
if (s != NULL) {
if (wcslen(s) <= 512)
wcscpy(wTitle, s);
else
wcsncpy(wTitle, s, 512);
} else
s = wTitle;
SetWindowText(hwndMain, s);
@@ -1097,7 +1100,7 @@ void
plat_pause(int p)
{
static wchar_t oldtitle[512];
wchar_t title[512];
wchar_t title[512], *t;
/* If un-pausing, as the renderer if that's OK. */
if (p == 0)
@@ -1113,7 +1116,11 @@ plat_pause(int p)
}
if (p) {
wcscpy(oldtitle, ui_window_title(NULL));
t = ui_window_title(NULL);
if (wcslen(t) <= 511)
wcscpy(oldtitle, ui_window_title(NULL));
else
wcsncpy(oldtitle, ui_window_title(NULL), 511);
wcscpy(title, oldtitle);
wcscat(title, L" - PAUSED -");
ui_window_title(title);