From: Tom Lane Date: Sat, 20 Oct 2012 16:44:18 +0000 (-0400) Subject: Prevent overflow in pgbench's percent-done display. X-Git-Tag: REL9_3_BETA1~758 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ca0b960eb502db429d9134b0ddf24b9e12f45257;p=postgresql Prevent overflow in pgbench's percent-done display. Per Thom Brown. --- diff --git a/contrib/pgbench/pgbench.c b/contrib/pgbench/pgbench.c index 5d48aeeae4..090c21019e 100644 --- a/contrib/pgbench/pgbench.c +++ b/contrib/pgbench/pgbench.c @@ -1444,7 +1444,7 @@ init(bool is_no_vacuum) if (j % 100000 == 0) fprintf(stderr, "%d of %d tuples (%d%%) done.\n", j, naccounts * scale, - j * 100 / (naccounts * scale)); + (int) (((int64) j * 100) / (naccounts * scale))); } if (PQputline(con, "\\.\n")) {