diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-10-23 23:17:22 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-10-23 23:17:22 +0000 |
commit | 88254d5756568c9e8d41e7b8272a0e48a5b149b5 (patch) | |
tree | 9fdf050654338fdc1317f49be80cc746b7433dad /numpy/core/src/ufuncobject.c | |
parent | 5817ed4ec7fa662f70a1401b521a8a6d785fe51f (diff) | |
download | numpy-88254d5756568c9e8d41e7b8272a0e48a5b149b5.tar.gz |
Initialize pos before calling PyDict_Next.
Diffstat (limited to 'numpy/core/src/ufuncobject.c')
-rw-r--r-- | numpy/core/src/ufuncobject.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/numpy/core/src/ufuncobject.c b/numpy/core/src/ufuncobject.c index b7697502d..053e55c7b 100644 --- a/numpy/core/src/ufuncobject.c +++ b/numpy/core/src/ufuncobject.c @@ -1613,21 +1613,23 @@ construct_loop(PyUFuncObject *self, PyObject *args, PyObject *kwds, PyArrayObjec */ if (kwds != NULL) { PyObject *key, *value; - Py_ssize_t pos; + Py_ssize_t pos=0; while (PyDict_Next(kwds, &pos, &key, &value)) { if (!PyString_Check(key)) { - PyErr_SetString(PyExc_TypeError, "invalid keyword"); + PyErr_SetString(PyExc_TypeError, + "invalid keyword"); goto fail; } - if (strncmp(PyString_AS_STRING(key), "extobj", 6) == 0) { + if (strncmp(PyString_AS_STRING(key),"extobj",6) == 0) { extobj = value; } - else if (strncmp(PyString_AS_STRING(key), "sig", 5) == 0) { + else if (strncmp(PyString_AS_STRING(key),"sig",5)==0) { typetup = value; } else { PyErr_Format(PyExc_TypeError, - "'%s' is an invalid keyword to %s", + "'%s' is an invalid keyword " \ + "to %s", PyString_AS_STRING(key), name); goto fail; } |