advapi32: Add RegOpen/CloseKey test and fixes

Dmitry Timoshkov dmitry at baikal.ru
Fri Feb 18 00:27:45 CST 2005


"James Hawkins" <truiken at gmail.com> wrote:

> +    static const WCHAR emptyW[] = {0};
> +
> +    if (!name || !strcmpW(name, emptyW)) {
> +        *retkey = hkey;
> +        return ERROR_SUCCESS;
> +    }

> +    if (!name || !strcmp(name, "")) {
> +        *retkey = hkey;
> +        return ERROR_SUCCESS;
> +    }

Instead of introducing emptyW and calling strcmp[W] with an empty
string it's much simpler and more readable to use in both cases:

if (!name || !*name)
{
    *retkey = hkey;
    return ERROR_SUCCESS;
}

-- 
Dmitry.




More information about the wine-devel mailing list