summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pstat
diff options
context:
space:
mode:
authored <ed@FreeBSD.org>2008-11-01 13:40:46 +0000
committered <ed@FreeBSD.org>2008-11-01 13:40:46 +0000
commit57b4089c2088a6a5dce2d7562cbb012f840d9c27 (patch)
treef6ba7119664a346582a4fda37a818b33ca7c9e5d /usr.sbin/pstat
parentc2c324d37976496417e7195d8daae3975be8eaa1 (diff)
downloadFreeBSD-src-57b4089c2088a6a5dce2d7562cbb012f840d9c27.zip
FreeBSD-src-57b4089c2088a6a5dce2d7562cbb012f840d9c27.tar.gz
Clamp the values of t_column to 5 digits in `pstat -t' and `show all ttys'.
We often run into these very high column numbers when we run curses applications, because they don't print any newlines. This messes up the table output of `pstat -t'. If these numbers get really high, they aren't of any use to the reader anyway. Convert them to `99999' when they run out of bounds.
Diffstat (limited to 'usr.sbin/pstat')
-rw-r--r--usr.sbin/pstat/pstat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/pstat/pstat.c b/usr.sbin/pstat/pstat.c
index a1e81b3..a33bd0a 100644
--- a/usr.sbin/pstat/pstat.c
+++ b/usr.sbin/pstat/pstat.c
@@ -334,7 +334,7 @@ ttyprt(struct xtty *xt)
xt->xt_insize, xt->xt_incc, xt->xt_inlc,
(xt->xt_insize - xt->xt_inlow), xt->xt_outsize,
xt->xt_outcc, (xt->xt_outsize - xt->xt_outlow),
- xt->xt_column, xt->xt_sid, xt->xt_pgid);
+ MIN(xt->xt_column, 99999), xt->xt_sid, xt->xt_pgid);
for (i = j = 0; ttystates[i].flag; i++)
if (xt->xt_flags & ttystates[i].flag) {
putchar(ttystates[i].val);
OpenPOWER on IntegriCloud