chiark / gitweb /
catacomb/__init__.py: Fix up cipher etc. names better.
[catacomb-python] / util.c
diff --git a/util.c b/util.c
index ed56e99a23bbcdb21cd881ff76a6c75b8522301b..8fab0bf59979e43e26fecd868a6a20d2ac3553f1 100644 (file)
--- 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 ------------------------------------------------------*/