Skip to content

Commit a339fe5

Browse files
kasper93sfan5
authored andcommitted
osdep/language-win: fix use of GetUserPreferredUILanguages()
Commit baf2fd2 fixed this for 2nd call to GetSystemPreferredUILanguages(), but apparently regressed the 1st call, duh. To retrieve the size both buffer has to be NULL and size 0. Memory has a lot of zeros, because it has been working quite consistently on CI.
1 parent 468d34c commit a339fe5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

osdep/language-win.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ char **mp_get_user_langs(void)
3939
char **ret = NULL;
4040
size_t ret_count = 0;
4141
wchar_t *buf = NULL;
42-
ULONG size, count;
42+
ULONG size = 0, count;
4343

4444
if (!GetUserPreferredUILanguages(MUI_LANGUAGE_NAME, &count, NULL, &size))
4545
goto done;

0 commit comments

Comments
 (0)