From 599deed91cc6a91fa83072ac21d8516a4647e174 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 20 Nov 2019 16:24:49 +0100 Subject: [PATCH] ntdll: Fix counting of environment strings. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48141 Signed-off-by: Alexandre Julliard --- dlls/ntdll/env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/ntdll/env.c b/dlls/ntdll/env.c index 6c7ca1e499e..79a1805618b 100644 --- a/dlls/ntdll/env.c +++ b/dlls/ntdll/env.c @@ -526,7 +526,7 @@ char **build_envp( const WCHAR *envW ) if (!(env = RtlAllocateHeap( GetProcessHeap(), 0, length ))) return NULL; ntdll_wcstoumbs( 0, envW, lenW, env, length, NULL, NULL ); - for (p = env; *p; p += strlen(p) + 1) + for (p = env; *p; p += strlen(p) + 1, count++) if (is_special_env_var( p )) length += 4; /* prefix it with "WINE" */ for (i = 0; i < ARRAY_SIZE( unix_vars ); i++)