1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 01:48:00 +00:00

Windows: initialise window_name and icon_name.

It turns out that they're still NULL at the first moment that a
SetWindowText call tries to read one of them, because they weren't
initialised at startup! Apparently SetWindowText notices that it's
been passed a null pointer, and does nothing in preference to failing,
but it's still not what I _meant_ to do.
This commit is contained in:
Simon Tatham 2022-03-12 14:33:01 +00:00
parent fe00a2928c
commit 901667280a

View File

@ -563,6 +563,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
if (vt && vt->flags & BACKEND_RESIZE_FORBIDDEN) if (vt && vt->flags & BACKEND_RESIZE_FORBIDDEN)
resize_forbidden = true; resize_forbidden = true;
wchar_t *uappname = dup_mb_to_wc(DEFAULT_CODEPAGE, 0, appname); wchar_t *uappname = dup_mb_to_wc(DEFAULT_CODEPAGE, 0, appname);
window_name = dup_mb_to_wc(DEFAULT_CODEPAGE, 0, appname);
icon_name = dup_mb_to_wc(DEFAULT_CODEPAGE, 0, appname);
if (!conf_get_bool(conf, CONF_scrollbar)) if (!conf_get_bool(conf, CONF_scrollbar))
winmode &= ~(WS_VSCROLL); winmode &= ~(WS_VSCROLL);
if (conf_get_int(conf, CONF_resize_action) == RESIZE_DISABLED || if (conf_get_int(conf, CONF_resize_action) == RESIZE_DISABLED ||