Commit 4b2756ba authored by Andrew Talbot's avatar Andrew Talbot Committed by Alexandre Julliard

regedit: Cast-qual warnings fix.

parent 9187951a
...@@ -89,13 +89,13 @@ static void error_code_messagebox(HWND hwnd, DWORD error_code) ...@@ -89,13 +89,13 @@ static void error_code_messagebox(HWND hwnd, DWORD error_code)
LPTSTR lpMsgBuf; LPTSTR lpMsgBuf;
DWORD status; DWORD status;
TCHAR title[256]; TCHAR title[256];
static const TCHAR fallback[] = TEXT("Error displaying error message.\n"); static TCHAR fallback[] = TEXT("Error displaying error message.\n");
if (!LoadString(hInst, IDS_ERROR, title, COUNT_OF(title))) if (!LoadString(hInst, IDS_ERROR, title, COUNT_OF(title)))
lstrcpy(title, TEXT("Error")); lstrcpy(title, TEXT("Error"));
status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, status = FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
NULL, error_code, 0, (LPTSTR)&lpMsgBuf, 0, NULL); NULL, error_code, 0, (LPTSTR)&lpMsgBuf, 0, NULL);
if (!status) if (!status)
lpMsgBuf = (LPTSTR)fallback; lpMsgBuf = fallback;
MessageBox(hwnd, lpMsgBuf, title, MB_OK | MB_ICONERROR); MessageBox(hwnd, lpMsgBuf, title, MB_OK | MB_ICONERROR);
if (lpMsgBuf != fallback) if (lpMsgBuf != fallback)
LocalFree(lpMsgBuf); LocalFree(lpMsgBuf);
...@@ -481,9 +481,12 @@ BOOL RenameKey(HWND hwnd, HKEY hRootKey, LPCTSTR keyPath, LPCTSTR newName) ...@@ -481,9 +481,12 @@ BOOL RenameKey(HWND hwnd, HKEY hRootKey, LPCTSTR keyPath, LPCTSTR newName)
parentKey = hRootKey; parentKey = hRootKey;
srcSubKey = keyPath; srcSubKey = keyPath;
} else { } else {
LPTSTR srcSubKey_copy;
parentPath = strdup(keyPath); parentPath = strdup(keyPath);
srcSubKey = strrchr(parentPath, '\\') + 1; srcSubKey_copy = strrchr(parentPath, '\\');
*((LPTSTR)srcSubKey - 1) = 0; *srcSubKey_copy = 0;
srcSubKey = srcSubKey_copy + 1;
lRet = RegOpenKeyEx(hRootKey, parentPath, 0, KEY_READ | KEY_CREATE_SUB_KEY, &parentKey); lRet = RegOpenKeyEx(hRootKey, parentPath, 0, KEY_READ | KEY_CREATE_SUB_KEY, &parentKey);
if (lRet != ERROR_SUCCESS) { if (lRet != ERROR_SUCCESS) {
error_code_messagebox(hwnd, lRet); error_code_messagebox(hwnd, lRet);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment