fio: fix overflow trying to use 'd' suffix
authorSitsofe Wheeler <sitsofe@yahoo.com>
Fri, 24 Feb 2017 01:38:18 +0000 (01:38 +0000)
committerSitsofe Wheeler <sitsofe@yahoo.com>
Fri, 24 Feb 2017 01:45:07 +0000 (01:45 +0000)
Fix overflow that happened when using the 'd' time suffix on platforms
with 32 bit longs which led to a time of less than 10 minutes being
used.

parse.c

diff --git a/parse.c b/parse.c
index fc508b674cff11555d2f3e5f73aea7a32d7cd101..fd5605f0c33f2bdb56dea64012b658d7d7c82b40 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -167,7 +167,7 @@ static unsigned long long get_mult_time(const char *str, int len,
        else if (!strcmp("h", c))
                mult = 60 * 60 * 1000000UL;
        else if (!strcmp("d", c))
-               mult = 24 * 60 * 60 * 1000000UL;
+               mult = 24 * 60 * 60 * 1000000ULL;
 
        free(c);
        return mult;