Fix overflow in percentile calculation for Windows
[fio.git] / stat.c
diff --git a/stat.c b/stat.c
index c5a68ad5c489cb0baf083220edbd63c4d2bcf591..5c75868051857582d0e0152287bc37260ace6340 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -139,7 +139,7 @@ unsigned int calc_clat_percentiles(unsigned int *io_u_plat, unsigned long nr,
                                   fio_fp64_t *plist, unsigned long long **output,
                                   unsigned long long *maxv, unsigned long long *minv)
 {
-       unsigned long sum = 0;
+       unsigned long long sum = 0;
        unsigned int len, i, j = 0;
        unsigned int oval_len = 0;
        unsigned long long *ovals = NULL;