regedit: Do not write junk after the LastKey value.

This commit is contained in:
Detlef Riekenberg 2009-08-25 10:21:58 +02:00 committed by Alexandre Julliard
parent 2b345484bc
commit 69b3782a82
1 changed files with 1 additions and 1 deletions

View File

@ -264,7 +264,7 @@ static void set_last_key(HWND hwndTV)
if (RegCreateKeyExW(HKEY_CURRENT_USER, wszKeyName, 0, NULL, 0, KEY_WRITE, NULL, &hkey, NULL) == ERROR_SUCCESS) if (RegCreateKeyExW(HKEY_CURRENT_USER, wszKeyName, 0, NULL, 0, KEY_WRITE, NULL, &hkey, NULL) == ERROR_SUCCESS)
{ {
wszVal = GetItemFullPath(g_pChildWnd->hTreeWnd, TreeView_GetSelection(g_pChildWnd->hTreeWnd), FALSE); wszVal = GetItemFullPath(g_pChildWnd->hTreeWnd, TreeView_GetSelection(g_pChildWnd->hTreeWnd), FALSE);
RegSetValueExW(hkey, wszLastKey, 0, REG_SZ, (LPBYTE)wszVal, KEY_MAX_LEN * sizeof(WCHAR)); RegSetValueExW(hkey, wszLastKey, 0, REG_SZ, (LPBYTE)wszVal, (lstrlenW(wszVal) + 1) * sizeof(WCHAR));
HeapFree(GetProcessHeap(), 0, wszVal); HeapFree(GetProcessHeap(), 0, wszVal);
RegCloseKey(hkey); RegCloseKey(hkey);
} }