summaryrefslogtreecommitdiffstats
path: root/PC/_winreg.c
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2006-02-18 23:44:24 (GMT)
committerGeorg Brandl <georg@python.org>2006-02-18 23:44:24 (GMT)
commitb2699b242d46312be13e7093ecf59ff949a190f7 (patch)
tree4efd1bbc0ae05d62b302eb952ef67b6aecb6a847 /PC/_winreg.c
parent9a928e787cd645b59c094a3696f6680f1615aec9 (diff)
downloadcpython-b2699b242d46312be13e7093ecf59ff949a190f7.zip
cpython-b2699b242d46312be13e7093ecf59ff949a190f7.tar.gz
cpython-b2699b242d46312be13e7093ecf59ff949a190f7.tar.bz2
Add sizeof() instead of hardcoding variable length
Diffstat (limited to 'PC/_winreg.c')
-rw-r--r--PC/_winreg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/PC/_winreg.c b/PC/_winreg.c
index c97bbc6..d402758 100644
--- a/PC/_winreg.c
+++ b/PC/_winreg.c
@@ -1033,8 +1033,8 @@ PyEnumKey(PyObject *self, PyObject *args)
long rc;
PyObject *retStr;
char *retBuf;
- DWORD len = 256; /* includes NULL terminator */
char tmpbuf[256]; /* max key name length is 255 */
+ DWORD len = sizeof(tmpbuf); /* includes NULL terminator */
if (!PyArg_ParseTuple(args, "Oi:EnumKey", &obKey, &index))
return NULL;