[PATCH 2/2] regedit: Re-implement convertHextToDWord() (v3)

Hugh McMaster hugh.mcmaster at outlook.com
Mon Apr 10 16:06:50 CDT 2017


> On 11 Apr 2017, at 5:06 am, Alexandre Julliard <julliard at winehq.org> wrote:
> 
> Hugh McMaster <hugh.mcmaster at outlook.com> writes:
> 
>> +    while (*buf == ' ' || *buf == '\t') buf++;
>> +    if (!*buf) goto exit;
>> +
>> +    p = buf;
>> +    while (isxdigit(*p))
>> +    {
>> +        count++;
>> +        p++;
>>     }
>> -    return TRUE;
>> +    if (count > 8) goto exit;
>> +
>> +    end = p;
>> +    while (*p == ' ' || *p == '\t') p++;
>> +    if (*p && *p != ';') goto exit;
>> +
>> +    *end = 0;
>> +    *dw = strtoul(buf, &end, 16);
>> +    ret = TRUE;
>> +
>> +    exit:
>> +    if (!ret) output_message(STRING_INVALID_HEX);
>> +    HeapFree(GetProcessHeap(), 0, buf);
> 
> The pointer has been modified, you need to free the original one.
> 
Okay. While I'm looking at this again, do you want everything done in WCHARs? The conversion to char* is a holdover from the original code.


More information about the wine-devel mailing list