aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/vmstat
diff options
context:
space:
mode:
authorPaul Saab <ps@FreeBSD.org>2005-02-21 14:35:00 +0000
committerPaul Saab <ps@FreeBSD.org>2005-02-21 14:35:00 +0000
commit043da612df66cdf04d2274d09cefdab321fc5c28 (patch)
treec762d15c2287526219ef34157fab206e8e4d6c5e /usr.bin/vmstat
parentc364c823d00b0f4910a80db7937d11b7313aece7 (diff)
downloadsrc-043da612df66cdf04d2274d09cefdab321fc5c28.tar.gz
src-043da612df66cdf04d2274d09cefdab321fc5c28.zip
Fix an overflow when calculating the number of kilobytes from the
number of pages. Obtained from: Yahoo!
Notes
Notes: svn path=/head/; revision=142175
Diffstat (limited to 'usr.bin/vmstat')
-rw-r--r--usr.bin/vmstat/vmstat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c
index 1bea1c5adbed..bee2ffb43895 100644
--- a/usr.bin/vmstat/vmstat.c
+++ b/usr.bin/vmstat/vmstat.c
@@ -588,7 +588,7 @@ dovmstat(unsigned int interval, int reps)
fill_vmtotal(&total);
(void)printf("%2d %1d %1d",
total.t_rq - 1, total.t_dw + total.t_pw, total.t_sw);
-#define vmstat_pgtok(a) ((a) * sum.v_page_size >> 10)
+#define vmstat_pgtok(a) ((a) * (sum.v_page_size >> 10))
#define rate(x) (((x) + halfuptime) / uptime) /* round */
(void)printf(" %7ld %6ld ", (long)vmstat_pgtok(total.t_avm),
(long)vmstat_pgtok(total.t_free));