summaryrefslogtreecommitdiffstats
path: root/usr.bin/vmstat/vmstat.c
diff options
context:
space:
mode:
authorps <ps@FreeBSD.org>2005-02-21 14:35:00 +0000
committerps <ps@FreeBSD.org>2005-02-21 14:35:00 +0000
commitc9d616766c09defb6febeed06f19ba9dc8737a52 (patch)
treec762d15c2287526219ef34157fab206e8e4d6c5e /usr.bin/vmstat/vmstat.c
parent42f4eba53e633434f928080a746eb1aa1e81e044 (diff)
downloadFreeBSD-src-c9d616766c09defb6febeed06f19ba9dc8737a52.zip
FreeBSD-src-c9d616766c09defb6febeed06f19ba9dc8737a52.tar.gz
Fix an overflow when calculating the number of kilobytes from the
number of pages. Obtained from: Yahoo!
Diffstat (limited to 'usr.bin/vmstat/vmstat.c')
-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 1bea1c5..bee2ffb 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));
OpenPOWER on IntegriCloud