Francois Gouget : kernel32: Fix an off-by-one error in build_envp().

Alexandre Julliard julliard at winehq.org
Wed Feb 18 10:15:25 CST 2009


Module: wine
Branch: master
Commit: 4a8e1feeb400227c9dc02c15ada62a3e9bd7acb1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4a8e1feeb400227c9dc02c15ada62a3e9bd7acb1

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Feb 17 18:56:22 2009 +0100

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 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/dlls/kernel32/process.c b/dlls/kernel32/process.c
index 56e23b8..bb8c428 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;




More information about the wine-cvs mailing list