summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1999-03-22 03:44:01 +0000
committerBruce Evans <bde@FreeBSD.org>1999-03-22 03:44:01 +0000
commit0af0a4b0f47ea01e2aedeeb647774899a6ae0820 (patch)
treea122e0be13c1be0b74a895880a53fac847e6552b
parentfc8fc1d234060eaa91307ca6984c0ca6c41830dd (diff)
Notes
-rw-r--r--usr.bin/systat/vmstat.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c
index ca45c483ff26..9deac76ac58e 100644
--- a/usr.bin/systat/vmstat.c
+++ b/usr.bin/systat/vmstat.c
@@ -36,7 +36,7 @@
static char sccsid[] = "@(#)vmstat.c 8.2 (Berkeley) 1/12/94";
#endif
static const char rcsid[] =
- "$Id: vmstat.c,v 1.33 1999/02/08 02:11:52 dillon Exp $";
+ "$Id: vmstat.c,v 1.34 1999/02/08 02:39:45 dillon Exp $";
#endif /* not lint */
/*
@@ -684,6 +684,8 @@ putfloat(f, l, c, w, d, nz)
return;
}
snprintf(b, sizeof(b), "%*.*f", w, d, f);
+ if (strlen(b) > w)
+ snprintf(b, sizeof(b), "%*.0f", w, f);
if (strlen(b) > w) {
while (--w >= 0)
addch('*');
@@ -706,6 +708,8 @@ putlongdouble(f, l, c, w, d, nz)
return;
}
sprintf(b, "%*.*Lf", w, d, f);
+ if (strlen(b) > w)
+ sprintf(b, "%*.0Lf", w, f);
if (strlen(b) > w) {
while (--w >= 0)
addch('*');