userenv: Use strncmpiW instead of memicmpW for strings without embedded nulls.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2019-05-08 08:35:15 -05:00
parent 1dd25f2dea
commit 3c53e06b7b
1 changed files with 3 additions and 5 deletions

View File

@ -111,15 +111,13 @@ static void set_registry_variables(WCHAR **env, HKEY hkey, DWORD type, BOOL set_
if (ret != ERROR_SUCCESS)
break;
if (!memicmpW(name, SystemRootW, ARRAY_SIZE(SystemRootW)))
continue;
if (!memicmpW(name, SystemDriveW, ARRAY_SIZE(SystemDriveW)))
continue;
if (!strcmpiW(name, SystemRootW)) continue;
if (!strcmpiW(name, SystemDriveW)) continue;
RtlInitUnicodeString(&us_name, name);
us_value.Buffer = value;
us_value.MaximumLength = sizeof(value);
if (!memicmpW(name, PATHW, ARRAY_SIZE(PATHW)) &&
if (!strncmpiW(name, PATHW, ARRAY_SIZE(PATHW)) &&
!RtlQueryEnvironmentVariable_U(*env, &us_name, &us_value))
{
if (!set_path)