From 3c53e06b7bfa7aaccd068e910185f23b788c83de Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 8 May 2019 08:35:15 -0500 Subject: [PATCH] userenv: Use strncmpiW instead of memicmpW for strings without embedded nulls. Signed-off-by: Alexandre Julliard --- dlls/userenv/userenv_main.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/dlls/userenv/userenv_main.c b/dlls/userenv/userenv_main.c index 11a4f756543..4a38c9a0544 100644 --- a/dlls/userenv/userenv_main.c +++ b/dlls/userenv/userenv_main.c @@ -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)