summaryrefslogtreecommitdiffstats
path: root/usr.bin
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-03-22 03:44:01 +0000
committerbde <bde@FreeBSD.org>1999-03-22 03:44:01 +0000
commitb97a8798b9d0cbdd363e775de2d1d29309390636 (patch)
tree1f361de9f21be144662a0726fa339decf8fe2115 /usr.bin
parent7395a30f200b2d1dc9bc882eac6bf20d1e984548 (diff)
downloadFreeBSD-src-b97a8798b9d0cbdd363e775de2d1d29309390636.zip
FreeBSD-src-b97a8798b9d0cbdd363e775de2d1d29309390636.tar.gz
Display floats with format %*.0f instead of as "*****" if there is
enough space for this but not enough space for the normal %*.*f format. Similarly for long doubles.
Diffstat (limited to 'usr.bin')
-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 ca45c48..9deac76 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('*');
OpenPOWER on IntegriCloud