* environ.cc (build_env): Fix length calculation of resulting

wide char environment string.
This commit is contained in:
Corinna Vinschen 2009-04-02 17:44:01 +00:00
parent be37a55086
commit eab96f6b22
2 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2009-04-02 Corinna Vinschen <corinna@vinschen.de>
* environ.cc (build_env): Fix length calculation of resulting
wide char environment string.
2009-04-02 Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
* include/netdb.h: #include <inttypes.h>, <netinet/in.h>,

View File

@ -1080,7 +1080,7 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
else
p = *srcp; /* Don't worry about it */
len = strlen (p) + 1;
len = sys_mbstowcs (NULL, 0, p);
new_tl += len; /* Keep running total of block length so far */
/* See if we need to increase the size of the block. */
@ -1097,7 +1097,7 @@ build_env (const char * const *envp, PWCHAR &envblock, int &envc,
}
}
int slen = sys_mbstowcs (s, len, p, len);
int slen = sys_mbstowcs (s, len, p);
/* See if environment variable is "special" in a Windows sense.
Under NT, the current directories for visited drives are stored