Commit 789cf283 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

regedit: Use wide character string literals in edit.c.

parent 6b6d084b
......@@ -85,15 +85,12 @@ static void WINAPIV error_code_messagebox(HWND hwnd, unsigned int msg_id, ...)
static BOOL change_dword_base(HWND hwndDlg, BOOL toHex)
{
static const WCHAR percent_u[] = {'%','u',0};
static const WCHAR percent_x[] = {'%','x',0};
WCHAR buf[128];
DWORD val;
if (!GetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, buf, ARRAY_SIZE(buf))) return FALSE;
if (!swscanf(buf, toHex ? percent_u : percent_x, &val)) return FALSE;
wsprintfW(buf, toHex ? percent_x : percent_u, val);
if (!swscanf(buf, toHex ? L"%u" : L"%x", &val)) return FALSE;
wsprintfW(buf, toHex ? L"%x" : L"%u", val);
return SetDlgItemTextW(hwndDlg, IDC_VALUE_DATA, buf);
}
......@@ -281,10 +278,9 @@ BOOL ModifyValue(HWND hwnd, HKEY hKeyRoot, LPCWSTR keyPath, LPCWSTR valueName)
else error_code_messagebox(hwnd, IDS_SET_VALUE_FAILED);
}
} else if ( type == REG_DWORD ) {
static const WCHAR x[] = {'%','x',0};
DWORD value = *((DWORD*)stringValueData);
stringValueData = heap_xrealloc(stringValueData, 64);
wsprintfW(stringValueData, x, value);
wsprintfW(stringValueData, L"%x", value);
if (DialogBoxW(0, MAKEINTRESOURCEW(IDD_EDIT_DWORD), hwnd, modify_dlgproc) == IDOK) {
DWORD val;
CHAR* valueA = GetMultiByteString(stringValueData);
......
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