X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/e2d3325517795887e5b36ef00e32a92b815c1bcb..d8413ace91998ed305db4d80d432ec6029ebf9ad:/key.c diff --git a/key.c b/key.c index dc1b849..4995035 100644 --- a/key.c +++ b/key.c @@ -38,7 +38,9 @@ static PyObject *kxmeth___init__(PyObject *me, PyObject *arg) { int err; PyObject *x = 0; + Py_ssize_t n; + n = PyTuple_GET_SIZE(arg); if (!PyArg_ParseTuple(arg, "Oi:__init__", &me, &err) || (x = PyInt_FromLong(err)) == 0 || PyObject_SetAttrString(me, "err", x)) @@ -48,7 +50,7 @@ static PyObject *kxmeth___init__(PyObject *me, PyObject *arg) PyObject_SetAttrString(me, "errstring", x)) goto end; Py_DECREF(x); x = 0; - if ((x = PyTuple_GetSlice(arg, 1, PyTuple_GET_SIZE(arg))) == 0 || + if ((x = PyTuple_GetSlice(arg, 1, n)) == 0 || PyObject_SetAttrString(me, "args", x)) goto end; Py_DECREF(x); x = 0;