summaryrefslogtreecommitdiffstats
path: root/Modules/posixmodule.c
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-12-13 20:41:12 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-12-13 20:41:12 (GMT)
commit6b8f0c892a075488fb6799bf5dbb9ed6743d31e2 (patch)
treedebfc36c18d6b6b84c91fbdd4fbd4e2383bbe95e /Modules/posixmodule.c
parente33baf8b83f2b9ee29e76f1b84cc49fe355e2b9f (diff)
parented53782ed56df61a6437ee8c5c548d7955e85551 (diff)
downloadcpython-6b8f0c892a075488fb6799bf5dbb9ed6743d31e2.zip
cpython-6b8f0c892a075488fb6799bf5dbb9ed6743d31e2.tar.gz
cpython-6b8f0c892a075488fb6799bf5dbb9ed6743d31e2.tar.bz2
(Merge 3.5) Issue #25846: Fix usage of Py_ARRAY_LENGTH() in win32_wchdir()
Diffstat (limited to 'Modules/posixmodule.c')
-rw-r--r--Modules/posixmodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 467ce2c..ce5960c 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1345,13 +1345,13 @@ win32_chdir(LPCSTR path)
static BOOL __stdcall
win32_wchdir(LPCWSTR path)
{
- wchar_t _new_path[MAX_PATH], *new_path = _new_path;
+ wchar_t path_buf[MAX_PATH], *new_path = path_buf;
int result;
wchar_t env[4] = L"=x:";
if(!SetCurrentDirectoryW(path))
return FALSE;
- result = GetCurrentDirectoryW(Py_ARRAY_LENGTH(new_path), new_path);
+ result = GetCurrentDirectoryW(Py_ARRAY_LENGTH(path_buf), new_path);
if (!result)
return FALSE;
if (result > Py_ARRAY_LENGTH(new_path)) {
@@ -1372,7 +1372,7 @@ win32_wchdir(LPCWSTR path)
return TRUE;
env[1] = new_path[0];
result = SetEnvironmentVariableW(env, new_path);
- if (new_path != _new_path)
+ if (new_path != path_buf)
PyMem_RawFree(new_path);
return result;
}