mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Add sizeof() instead of hardcoding variable length
This commit is contained in:
parent
9a928e787c
commit
b2699b242d
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue