Commit acb4e3f6 authored by Hugh McMaster's avatar Hugh McMaster Committed by Alexandre Julliard

reg: Explicitly use base 10 or base 16 with strtoulW.

All Windows versions, except XP, parse the number 0123 as decimal. (XP parses 0123 as octal). Signed-off-by: 's avatarHugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 474361ec
......@@ -243,7 +243,7 @@ static LPBYTE get_regdata(LPWSTR data, DWORD reg_type, WCHAR separator, DWORD *r
{
LPWSTR rest;
DWORD val;
val = strtoulW(data, &rest, 0);
val = strtoulW(data, &rest, (data[1] == 'x') ? 16 : 10);
if (*rest || data[0] == '-') {
output_message(STRING_MISSING_INTEGER);
break;
......
......@@ -272,8 +272,7 @@ static void test_add(void)
ok(err == ERROR_SUCCESS, "RegQueryValueEx failed: got %d\n", err);
ok(type == REG_DWORD, "got wrong type %d, expected %d\n", type, REG_DWORD);
ok(size == sizeof(DWORD), "got wrong size %d, expected %d\n", size, (int)sizeof(DWORD));
todo_wine ok(dword == 123 || broken(dword == 0123 /* WinXP */),
"got wrong data %d, expected %d\n", dword, 123);
ok(dword == 123 || broken(dword == 0123 /* WinXP */), "got wrong data %d, expected 123\n", dword);
run_reg_exe("reg add HKCU\\" KEY_BASE " /v dword7 /t reg_dword /d 0xabcdefg /f", &r);
ok(r == REG_EXIT_FAILURE, "got exit code %d, expected 1\n", r);
......
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