aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/systat
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/systat
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/systat')
-rw-r--r--usr.bin/systat/vmstat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index a4a9269edb3f..bced789e4451 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -472,7 +472,7 @@ showkre()
putfloat(avenrun[1], STATROW, STATCOL + 23, 6, 2, 0);
putfloat(avenrun[2], STATROW, STATCOL + 29, 6, 2, 0);
mvaddstr(STATROW, STATCOL + 53, buf);
-#define pgtokb(pg) ((pg) * s.v_page_size / 1024)
+#define pgtokb(pg) ((pg) * (s.v_page_size / 1024))
putint(pgtokb(total.t_arm), MEMROW + 2, MEMCOL + 3, 8);
putint(pgtokb(total.t_armshr), MEMROW + 2, MEMCOL + 11, 8);
putint(pgtokb(total.t_avm), MEMROW + 2, MEMCOL + 19, 9);