Fix overflow caused by signed long division by unsigned long.
[fio.git] / gettime.c
index b896b5bd9923e7b818e9e88fe99eb0a369dd9f63..964a52fa237afe50a05cd7d9081c3e29c26c70fc 100644 (file)
--- a/gettime.c
+++ b/gettime.c
@@ -424,8 +424,8 @@ uint64_t mtime_since(const struct timeval *s, const struct timeval *e)
        if (sec < 0 || (sec == 0 && usec < 0))
                return 0;
 
-       sec *= 1000UL;
-       usec /= 1000UL;
+       sec *= 1000;
+       usec /= 1000;
        ret = sec + usec;
 
        return ret;