Hugh McMaster : regedit: Use wide character string literals in edit.c.
Module: wine Branch: master Commit: 789cf2837520f2969744ae5558a872bf2178c324 URL: https://source.winehq.org/git/wine.git/?a=commit;h=789cf2837520f2969744ae555... Author: Hugh McMaster <hugh.mcmaster(a)outlook.com> Date: Thu Apr 14 23:01:33 2022 +1000 regedit: Use wide character string literals in edit.c. Signed-off-by: Hugh McMaster <hugh.mcmaster(a)outlook.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- programs/regedit/edit.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/programs/regedit/edit.c b/programs/regedit/edit.c index 3f99626dd23..b808c38c51c 100644 --- a/programs/regedit/edit.c +++ b/programs/regedit/edit.c @@ -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);
participants (1)
-
Alexandre Julliard