summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/posixmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 465cb51..90c0aac 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -1412,7 +1412,7 @@ extract_time(PyObject *t, long* sec, long* usec)
intval = PyInt_AsLong(intobj);
Py_DECREF(intobj);
*sec = intval;
- *usec = (tval - intval) * 1e6;
+ *usec = (long)((tval - intval) * 1e6); /* can't exceed 1000000 */
if (*usec < 0)
/* If rounding gave us a negative number,
truncate. */