projects
/
python
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9a928e7
)
Add sizeof() instead of hardcoding variable length
author
Georg Brandl
<georg@python.org>
Sat, 18 Feb 2006 23:44:24 +0000
(23:44 +0000)
committer
Georg Brandl
<georg@python.org>
Sat, 18 Feb 2006 23:44:24 +0000
(23:44 +0000)
PC/_winreg.c
patch
|
blob
|
history
diff --git
a/PC/_winreg.c
b/PC/_winreg.c
index c97bbc6a07776776be409373b61a091dfb79dd33..d4027586093a56aac489fca64649d01917c1d0d3 100644
(file)
--- 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;