summaryrefslogtreecommitdiffstats
path: root/PC/import_nt.c
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2006-02-15 17:27:45 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2006-02-15 17:27:45 (GMT)
commit18e165558b24d29e7e0ca501842b9236589b012a (patch)
tree841678b5dc1aff3aa48701fee33a6ba7be00a72b /PC/import_nt.c
parent44829297348d9121a03fc7df2fac557b583cc7fa (diff)
downloadcpython-18e165558b24d29e7e0ca501842b9236589b012a.zip
cpython-18e165558b24d29e7e0ca501842b9236589b012a.tar.gz
cpython-18e165558b24d29e7e0ca501842b9236589b012a.tar.bz2
Merge ssize_t branch.
Diffstat (limited to 'PC/import_nt.c')
-rw-r--r--PC/import_nt.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/PC/import_nt.c b/PC/import_nt.c
index f937df8..e7d152a 100644
--- a/PC/import_nt.c
+++ b/PC/import_nt.c
@@ -18,7 +18,7 @@ extern const char *PyWin_DLLVersionString;
FILE *PyWin_FindRegisteredModule(const char *moduleName,
struct filedescr **ppFileDesc,
char *pathBuf,
- int pathLen)
+ Py_ssize_t pathLen)
{
char *moduleKey;
const char keyPrefix[] = "Software\\Python\\PythonCore\\";
@@ -53,13 +53,14 @@ FILE *PyWin_FindRegisteredModule(const char *moduleName,
"Software\\Python\\PythonCore\\%s\\Modules\\%s%s",
PyWin_DLLVersionString, moduleName, debugString);
- modNameSize = pathLen;
+ assert(pathLen < INT_MAX);
+ modNameSize = (int)pathLen;
regStat = RegQueryValue(keyBase, moduleKey, pathBuf, &modNameSize);
if (regStat != ERROR_SUCCESS) {
/* No user setting - lookup in machine settings */
keyBase = HKEY_LOCAL_MACHINE;
/* be anal - failure may have reset size param */
- modNameSize = pathLen;
+ modNameSize = (int)pathLen;
regStat = RegQueryValue(keyBase, moduleKey,
pathBuf, &modNameSize);