summaryrefslogtreecommitdiff
path: root/PC
diff options
context:
space:
mode:
authorBrian Curtin <brian.curtin@gmail.com>2010-06-08 21:00:35 +0000
committerBrian Curtin <brian.curtin@gmail.com>2010-06-08 21:00:35 +0000
commit7f99f092eb7a8b1f93e68c307f4d115a93cfa1c9 (patch)
tree6e08b76893321f319ff8a06a3947f558aa5bc440 /PC
parenta01c6b3c9e6f9e0d3411051a3ff646852b37b4d6 (diff)
downloadcpython-git-7f99f092eb7a8b1f93e68c307f4d115a93cfa1c9.tar.gz
Merged revisions 81843 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r81843 | brian.curtin | 2010-06-08 15:57:52 -0500 (Tue, 08 Jun 2010) | 3 lines Fix a compile warning missed during porting (wchar_t/char) and move a variable declaration outside of a loop. #2810 was when this first went in. ........
Diffstat (limited to 'PC')
-rw-r--r--PC/winreg.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/PC/winreg.c b/PC/winreg.c
index c321d9f48d..52d230e7b9 100644
--- a/PC/winreg.c
+++ b/PC/winreg.c
@@ -1036,6 +1036,7 @@ PyEnumValue(PyObject *self, PyObject *args)
int index;
long rc;
wchar_t *retValueBuf;
+ wchar_t *tmpBuf;
BYTE *retDataBuf;
DWORD retValueSize, bufValueSize;
DWORD retDataSize, bufDataSize;
@@ -1068,7 +1069,6 @@ PyEnumValue(PyObject *self, PyObject *args)
}
while (1) {
- wchar_t *tmp;
Py_BEGIN_ALLOW_THREADS
rc = RegEnumValueW(hKey,
index,
@@ -1084,13 +1084,13 @@ PyEnumValue(PyObject *self, PyObject *args)
break;
bufDataSize *= 2;
- tmp = (char *)PyMem_Realloc(retDataBuf, bufDataSize);
- if (tmp == NULL) {
+ tmpBuf = (wchar_t *)PyMem_Realloc(retDataBuf, bufDataSize);
+ if (tmpBuf == NULL) {
PyErr_NoMemory();
retVal = NULL;
goto fail;
}
- retDataBuf = tmp;
+ retDataBuf = tmpBuf;
retDataSize = bufDataSize;
retValueSize = bufValueSize;
}