From 4a8e1feeb400227c9dc02c15ada62a3e9bd7acb1 Mon Sep 17 00:00:00 2001 From: Francois Gouget Date: Tue, 17 Feb 2009 18:56:22 +0100 Subject: [PATCH] kernel32: Fix an off-by-one error in build_envp(). We need to take into account the trailing NULL in envp. --- dlls/kernel32/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c index 56e23b88ff..bb8c428b8b 100644 --- a/dlls/kernel32/process.c +++ b/dlls/kernel32/process.c @@ -1185,7 +1185,7 @@ static char **build_envp( const WCHAR *envW ) const WCHAR *end; char **envp; char *env, *p; - int count = 0, length; + int count = 1, length; unsigned int i; for (end = envW; *end; count++) end += strlenW(end) + 1;