Skip to content

Commit 076f08c

Browse files
[SYSSETUP] WriteUserLocale(): Fix Locale[] length and value (reactos#8090)
'Locale' format is "0000nnnn". CORE-15848
1 parent 6128c20 commit 076f08c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dll/win32/syssetup/wizard.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1455,11 +1455,11 @@ WriteUserLocale(VOID)
14551455
{
14561456
HKEY hKey;
14571457
LCID lcid;
1458-
WCHAR Locale[12];
1458+
WCHAR Locale[9] = L"0000";
14591459

14601460
lcid = GetSystemDefaultLCID();
14611461

1462-
if (GetLocaleInfoW(MAKELCID(lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, Locale, ARRAYSIZE(Locale)) != 0)
1462+
if (GetLocaleInfoW(MAKELCID(lcid, SORT_DEFAULT), LOCALE_ILANGUAGE, &Locale[4], _countof(Locale) - 4) != 0)
14631463
{
14641464
if (RegCreateKeyExW(HKEY_CURRENT_USER, L"Control Panel\\International",
14651465
0, NULL, REG_OPTION_NON_VOLATILE,

0 commit comments

Comments
 (0)