Modified: trunk/reactos/lib/cpl/intl/locale.c

Modified: trunk/reactos/lib/cpl/intl/locale.c
--- trunk/reactos/lib/cpl/intl/locale.c	2005-05-12 18:05:22 UTC (rev 15240)
+++ trunk/reactos/lib/cpl/intl/locale.c	2005-05-12 18:08:25 UTC (rev 15241)
@@ -95,7 +95,7 @@
 	HKEY langKey;
 	DWORD ret;
 	TCHAR value[9];
-	DWORD lenvalue;
+	DWORD valuesize;
 
 	ret = RegOpenKeyW(HKEY_CURRENT_USER, L"Control Panel\\International", &localeKey);
 
@@ -107,9 +107,9 @@
 	}
 
 	wsprintf(value, L"%04X", (DWORD)lcid);
-	lenvalue = wcslen(value) *  sizeof(WCHAR);
+	valuesize = (wcslen(value) + 1) * sizeof(WCHAR);
 
-	RegSetValueExW(localeKey, L"Locale", 0, REG_SZ, (BYTE *)value, lenvalue);
+	RegSetValueExW(localeKey, L"Locale", 0, REG_SZ, (BYTE *)value, valuesize);
 	RegCloseKey(localeKey);
 
 	// Set language
@@ -118,8 +118,8 @@
 	if (ret != ERROR_SUCCESS)
 		return;
 
-	RegSetValueExW(langKey, L"Default", 0, REG_SZ, (BYTE *)value, lenvalue );
-	RegSetValueExW(langKey, L"InstallLanguage", 0, REG_SZ, (BYTE *)value, lenvalue );
+	RegSetValueExW(langKey, L"Default", 0, REG_SZ, (BYTE *)value, valuesize );
+	RegSetValueExW(langKey, L"InstallLanguage", 0, REG_SZ, (BYTE *)value, valuesize );
 	RegCloseKey(langKey);
 }