From 7bdbfc96037640dbd352e9ddab9c5e1ded9502fa Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sat, 6 Nov 2010 16:29:27 +0100 Subject: ldb:pyldb.c - most of the times "time_t" is defined as "long int" Therefore use a signed long int for conversions. http://stackoverflow.com/questions/471248/what-is-ultimately-a-time-t-typedef-to --- source4/lib/ldb/pyldb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source4') diff --git a/source4/lib/ldb/pyldb.c b/source4/lib/ldb/pyldb.c index 794708b2e3..2f87b8cdc3 100644 --- a/source4/lib/ldb/pyldb.c +++ b/source4/lib/ldb/pyldb.c @@ -2587,14 +2587,14 @@ static PyObject *py_register_module(PyObject *module, PyObject *args) static PyObject *py_timestring(PyObject *module, PyObject *args) { - time_t t; - unsigned long val; + /* most times "time_t" is a signed integer type with 32 or 64 bit: + * http://stackoverflow.com/questions/471248/what-is-ultimately-a-time-t-typedef-to */ + long int t_val; char *tresult; PyObject *ret; - if (!PyArg_ParseTuple(args, "l", &val)) + if (!PyArg_ParseTuple(args, "l", &t_val)) return NULL; - t = (time_t)val; - tresult = ldb_timestring(NULL, t); + tresult = ldb_timestring(NULL, (time_t) t_val); ret = PyString_FromString(tresult); talloc_free(tresult); return ret; -- cgit