summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorotto <otto@openbsd.org>2006-11-13 19:03:51 +0000
committerotto <otto@openbsd.org>2006-11-13 19:03:51 +0000
commit4cfdee69e3fd33c2bf826d0ee7e827b7c3e452b1 (patch)
tree6037fbb2a83390b4e758584fbc20bb114d5a73e2
parentCheck strlcpy/strlcat return values; from usr.bin/rcs/rcsnum.c (diff)
downloadwireguard-openbsd-4cfdee69e3fd33c2bf826d0ee7e827b7c3e452b1.tar.xz
wireguard-openbsd-4cfdee69e3fd33c2bf826d0ee7e827b7c3e452b1.zip
fix macro abuse leading to stray numbers in the vm display.
ok a whole lot of devs@
-rw-r--r--usr.bin/systat/vmstat.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index 8fe15dc7e64..e758f334e3c 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vmstat.c,v 1.60 2006/04/14 01:14:56 dlg Exp $ */
+/* $OpenBSD: vmstat.c,v 1.61 2006/11/13 19:03:51 otto Exp $ */
/* $NetBSD: vmstat.c,v 1.5 1996/05/10 23:16:40 thorpej Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
#endif
-static char rcsid[] = "$OpenBSD: vmstat.c,v 1.60 2006/04/14 01:14:56 dlg Exp $";
+static char rcsid[] = "$OpenBSD: vmstat.c,v 1.61 2006/11/13 19:03:51 otto Exp $";
#endif /* not lint */
/*
@@ -299,8 +299,10 @@ labelkre(void)
#define Z(fld) {t = s.nchstats.fld; s.nchstats.fld -= s1.nchstats.fld; \
if (state == TIME) s1.nchstats.fld = t;}
#define PUTRATE(fld, l, c, w) \
- Y(fld); \
- putint((int)((float)s.fld/etime + 0.5), l, c, w)
+ do { \
+ Y(fld); \
+ putint((int)((float)s.fld/etime + 0.5), l, c, w); \
+ } while (0)
#define MAXFAIL 5
static char cpuchar[CPUSTATES] = { '|', '=', '>', '-', ' ' };