From: Guido van Rossum Date: Thu, 7 May 1998 16:29:10 +0000 (+0000) Subject: Add check to conjugate() that there are no excess arguments. X-Git-Tag: v1.5.2a1~712 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8530ef625aabda9d11ffcee8c4c6fd7230c05185;p=thirdparty%2FPython%2Fcpython.git Add check to conjugate() that there are no excess arguments. --- diff --git a/Objects/complexobject.c b/Objects/complexobject.c index a186c8ec583a..2e9771315614 100644 --- a/Objects/complexobject.c +++ b/Objects/complexobject.c @@ -573,17 +573,20 @@ complex_float(v) } static PyObject * -complex_conjugate(self) +complex_conjugate(self, args) PyObject *self; + PyObject *args; { Py_complex c; + if (!PyArg_ParseTuple(args, "")) + return NULL; c = ((PyComplexObject *)self)->cval; c.imag = -c.imag; return PyComplex_FromCComplex(c); } static PyMethodDef complex_methods[] = { - {"conjugate", (PyCFunction)complex_conjugate, 1}, + {"conjugate", complex_conjugate, 1}, {NULL, NULL} /* sentinel */ };