diff --git a/PC/winreg.c b/PC/winreg.c --- a/PC/winreg.c +++ b/PC/winreg.c @@ -1122,7 +1122,7 @@ * nul. RegEnumKeyEx requires a 257 character buffer to * retrieve such a key name. */ wchar_t tmpbuf[257]; - DWORD len = sizeof(tmpbuf); /* includes NULL terminator */ + DWORD len = sizeof(tmpbuf)/sizeof(wchar_t); /* includes NULL terminator */ if (!PyArg_ParseTuple(args, "Oi:EnumKey", &obKey, &index)) return NULL;