X-Git-Url: https://git.distorted.org.uk/~mdw/catacomb-python/blobdiff_plain/0156e4020eb3b13a1b9bcfa9887eb922ba5d9fa2..c0ddcbacacd1108395fce05c57db4ddd4d801888:/util.c diff --git a/util.c b/util.c index 8a0c06c..8fab0bf 100644 --- a/util.c +++ b/util.c @@ -60,6 +60,7 @@ int convulong(PyObject *o, void *pp) unsigned long *p = pp; PyObject *t; + if (!o) VALERR("can't delete"); if (PyInt_Check(o)) { i = PyInt_AS_LONG(o); if (i < 0) VALERR("must be nonnegative"); @@ -131,8 +132,11 @@ end: int convbool(PyObject *o, void *pp) { + if (!o) VALERR("can't delete"); *(int *)pp = PyObject_IsTrue(o); return (1); +end: + return (0); } /*----- Type messing ------------------------------------------------------*/ @@ -413,7 +417,7 @@ PySequenceMethods gmap_pysequence = { 0 /* @sq_inplace_repeat@ */ }; -int gmap_pysize(PyObject *me) +Py_ssize_t gmap_pysize(PyObject *me) { PyObject *i = 0, *x = 0; int rc = -1;