X-Git-Url: https://git.distorted.org.uk/~mdw/pyke/blobdiff_plain/6f1a40f35fb71ef4c2dbb0e92b8aaff1620a2ad1..c0ddcbacacd1108395fce05c57db4ddd4d801888:/util.c diff --git a/util.c b/util.c index ed56e99..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 ------------------------------------------------------*/