From owner-cvs-all@FreeBSD.ORG Tue Oct 21 00:46:24 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5B6A416A4B3; Tue, 21 Oct 2003 00:46:24 -0700 (PDT) Received: from milla.ask33.net (milla.ask33.net [217.197.166.60]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6229243F85; Tue, 21 Oct 2003 00:46:23 -0700 (PDT) (envelope-from nick@milla.ask33.net) Received: by milla.ask33.net (Postfix, from userid 1001) id A0BB13ABB4E; Tue, 21 Oct 2003 09:43:26 +0200 (CEST) Date: Tue, 21 Oct 2003 09:43:26 +0200 From: Pawel Jakub Dawidek To: Poul-Henning Kamp Message-ID: <20031021074326.GZ520@garage.freebsd.pl> References: <200310202013.h9KKDpnr086806@repoman.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="4BbZpS4xx+iYF6kJ" Content-Disposition: inline In-Reply-To: <200310202013.h9KKDpnr086806@repoman.freebsd.org> X-PGP-Key-URL: http://garage.freebsd.pl/jules.asc X-OS: FreeBSD 4.8-RELEASE-p9 i386 X-URL: http://garage.freebsd.pl User-Agent: Mutt/1.5.1i cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/usr.bin/systat devs.c vmstat.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 21 Oct 2003 07:46:24 -0000 --4BbZpS4xx+iYF6kJ Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Oct 20, 2003 at 01:13:51PM -0700, Poul-Henning Kamp wrote: +> Commiter: Poul-Henning Kamp +> Branch: HEAD +>=20 +> Files: +> 1.9 src/usr.bin/systat/devs.c =20 +> 1.58 src/usr.bin/systat/vmstat.c =20 +>=20 +> Log: +> When a numeric field overflows its width, try formatting the number in +> 'kilo' or 'mega' with appropriate suffix instead of filling the field +> with stars. [...] +> @@ -678,11 +678,10 @@ putint(n, l, lc, w) +> return; +> } +> snprintf(b, sizeof(b), "%*d", w, n); +> - if ((int)strlen(b) > w) { +> - while (w-- > 0) +> - addch('*'); +> - return; +> - } +> + if ((int)strlen(b) > w) +> + snprintf(b, sizeof(b), "%*dK", w - 1, n / 1000); +> + if ((int)strlen(b) > w) +> + snprintf(b, sizeof(b), "%*dM", w - 1, n / 1000000); +> addstr(b); +> } 'Kilo' is lowercase 'k':) --=20 Pawel Jakub Dawidek pawel@dawidek.net UNIX Systems Programmer/Administrator http://garage.freebsd.pl Am I Evil? Yes, I Am! http://cerber.sourceforge.net --4BbZpS4xx+iYF6kJ Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (FreeBSD) iQCVAwUBP5Tjnj/PhmMH/Mf1AQEM/QQApeeGsjDqM/d2x5LDV8WephUkYDcAQmr3 xWkL4t9eVaUlazXmGrWwI7gaFE8ZqafdwB6eqRxaLTH5r+EMmingn3wQ0hUubFk0 PXgvWSONDErnYs4WknxDoRJqbGY8KoC2eeTJpYQpi3mpNGtfu4X+CcWUr38aZEDK lKSaEjgG1pA= =sltM -----END PGP SIGNATURE----- --4BbZpS4xx+iYF6kJ--