From 764bf50c216b86053a345f6eb68d60b78044520f Mon Sep 17 00:00:00 2001 From: Can Erkin Acar Date: Fri, 13 Jun 2008 17:45:03 +0000 Subject: Fix size and age field printing. The fields will now be printed with units instead of getting truncated. --- usr.bin/systat/engine.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'usr.bin') diff --git a/usr.bin/systat/engine.c b/usr.bin/systat/engine.c index 9dab76ed55a..512e5def1d1 100644 --- a/usr.bin/systat/engine.c +++ b/usr.bin/systat/engine.c @@ -1,4 +1,4 @@ -/* $Id: engine.c,v 1.2 2008/06/13 01:06:06 canacar Exp $ */ +/* $Id: engine.c,v 1.3 2008/06/13 17:45:02 canacar Exp $ */ /* * Copyright (c) 2001, 2007 Can Erkin Acar * @@ -625,21 +625,25 @@ print_fld_age(field_def *fld, unsigned int age) if (tbprintf("%02u:%02u:%02u", h, m, s) <= len) goto ok; + tb_start(); if (tbprintf("%u", age) <= len) goto ok; + tb_start(); age /= 60; if (tbprintf("%um", age) <= len) goto ok; if (age == 0) goto err; + tb_start(); age /= 60; if (tbprintf("%uh", age) <= len) goto ok; if (age == 0) goto err; + tb_start(); age /= 24; if (tbprintf("%ud", age) <= len) goto ok; @@ -669,18 +673,21 @@ print_fld_sdiv(field_def *fld, u_int64_t size, int div) if (tbprintf("%llu", size) <= len) goto ok; + tb_start(); size /= div; if (tbprintf("%lluK", size) <= len) goto ok; if (size == 0) goto err; + tb_start(); size /= div; if (tbprintf("%lluM", size) <= len) goto ok; if (size == 0) goto err; + tb_start(); size /= div; if (tbprintf("%lluG", size) <= len) goto ok; -- cgit v1.2.3