diff options
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r-- | source4/lib/ldb/pyldb.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c index 40d7204c35..acf8052127 100644 --- a/source4/lib/ldb/pyldb.c +++ b/source4/lib/ldb/pyldb.c @@ -1765,10 +1765,10 @@ static PyObject *ldb_msg_element_to_set(struct ldb_context *ldb_ctx, static PyObject *py_ldb_msg_element_get(PyLdbMessageElementObject *self, PyObject *args) { - int i; - if (!PyArg_ParseTuple(args, "i", &i)) + unsigned int i; + if (!PyArg_ParseTuple(args, "I", &i)) return NULL; - if (i < 0 || i >= PyLdbMessageElement_AsMessageElement(self)->num_values) + if (i >= PyLdbMessageElement_AsMessageElement(self)->num_values) Py_RETURN_NONE; return PyObject_FromLdbValue(NULL, PyLdbMessageElement_AsMessageElement(self), |