diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-11-06 16:29:27 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-11-08 10:39:05 +0000 |
commit | 7bdbfc96037640dbd352e9ddab9c5e1ded9502fa (patch) | |
tree | 36ffff33e35e80cf3a9a6315b126fdf242605f60 /source4/lib | |
parent | 9e5ca72afbe74d88a1da33b6957b0914262f106c (diff) | |
download | samba-7bdbfc96037640dbd352e9ddab9c5e1ded9502fa.tar.gz samba-7bdbfc96037640dbd352e9ddab9c5e1ded9502fa.tar.bz2 samba-7bdbfc96037640dbd352e9ddab9c5e1ded9502fa.zip |
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
Diffstat (limited to 'source4/lib')
-rw-r--r-- | source4/lib/ldb/pyldb.c | 10 |
1 files changed, 5 insertions, 5 deletions
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; |