chiark
/
gitweb
/
~mdw
/
pyke
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '1.1.x'
[pyke]
/
util.c
diff --git
a/util.c
b/util.c
index 58d2fe7ebd7525998e4211983541b3ed5125fa6d..d4b7fb060d189ffbea18e68cc1f4d572cb7ef391 100644
(file)
--- a/
util.c
+++ b/
util.c
@@
-83,6
+83,7
@@
int convulong(PyObject *o, void *pp)
unsigned long *p = pp;
PyObject *t;
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");
if (PyInt_Check(o)) {
i = PyInt_AS_LONG(o);
if (i < 0) VALERR("must be nonnegative");
@@
-176,8
+177,11
@@
end:
int convbool(PyObject *o, void *pp)
{
int convbool(PyObject *o, void *pp)
{
+ if (!o) VALERR("can't delete");
*(int *)pp = PyObject_IsTrue(o);
return (1);
*(int *)pp = PyObject_IsTrue(o);
return (1);
+end:
+ return (0);
}
/*----- Type messing ------------------------------------------------------*/
}
/*----- Type messing ------------------------------------------------------*/