diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-04-02 17:44:01 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-04-02 17:44:01 +0000 |
commit | eab96f6b22353141b4ff2c78828a36722c6026c4 (patch) | |
tree | 61bdbd45226551f40dc13b003209269da788937a /winsup/cygwin/environ.cc | |
parent | be37a55086d3fcb0e999d4048fca171316e01c35 (diff) | |
download | cygnal-eab96f6b22353141b4ff2c78828a36722c6026c4.tar.gz cygnal-eab96f6b22353141b4ff2c78828a36722c6026c4.tar.bz2 cygnal-eab96f6b22353141b4ff2c78828a36722c6026c4.zip |
* environ.cc (build_env): Fix length calculation of resulting
wide char environment string.
Diffstat (limited to 'winsup/cygwin/environ.cc')
-rw-r--r-- | winsup/cygwin/environ.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index 75e1ffb37..8124e68b2 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -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 |