From 901667280ae2708df3a73618f85a03af15a8dcd6 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sat, 12 Mar 2022 14:33:01 +0000 Subject: [PATCH] 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. --- windows/window.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/windows/window.c b/windows/window.c index 39a7ca34..1bc12fd7 100644 --- a/windows/window.c +++ b/windows/window.c @@ -563,6 +563,8 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) if (vt && vt->flags & BACKEND_RESIZE_FORBIDDEN) resize_forbidden = true; 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)) winmode &= ~(WS_VSCROLL); if (conf_get_int(conf, CONF_resize_action) == RESIZE_DISABLED ||