From owner-svn-src-head@FreeBSD.ORG Fri Jan 30 14:28:51 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 05FAA1065672; Fri, 30 Jan 2009 14:28:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7E508FC08; Fri, 30 Jan 2009 14:28:50 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0UESoEa094237; Fri, 30 Jan 2009 14:28:50 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0UESow0094236; Fri, 30 Jan 2009 14:28:50 GMT (envelope-from des@svn.freebsd.org) Message-Id: <200901301428.n0UESow0094236@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Fri, 30 Jan 2009 14:28:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187915 - head/usr.bin/sockstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jan 2009 14:28:51 -0000 Author: des Date: Fri Jan 30 14:28:50 2009 New Revision: 187915 URL: http://svn.freebsd.org/changeset/base/187915 Log: Make sure the entries don't run into each other when they're longer than the allotted space. PR: bin/129318 Submitted by: Ighighi MFC after: 3 weeks Modified: head/usr.bin/sockstat/sockstat.c Modified: head/usr.bin/sockstat/sockstat.c ============================================================================== --- head/usr.bin/sockstat/sockstat.c Fri Jan 30 13:54:03 2009 (r187914) +++ head/usr.bin/sockstat/sockstat.c Fri Jan 30 14:28:50 2009 (r187915) @@ -596,25 +596,25 @@ display(void) continue; pos = 0; if ((pwd = getpwuid(xf->xf_uid)) == NULL) - pos += xprintf("%lu", (u_long)xf->xf_uid); + pos += xprintf("%lu ", (u_long)xf->xf_uid); else - pos += xprintf("%s", pwd->pw_name); + pos += xprintf("%s ", pwd->pw_name); while (pos < 9) pos += xprintf(" "); pos += xprintf("%.10s", getprocname(xf->xf_pid)); while (pos < 20) pos += xprintf(" "); - pos += xprintf("%lu", (u_long)xf->xf_pid); + pos += xprintf("%lu ", (u_long)xf->xf_pid); while (pos < 26) pos += xprintf(" "); - pos += xprintf("%d", xf->xf_fd); + pos += xprintf("%d ", xf->xf_fd); while (pos < 29) pos += xprintf(" "); pos += xprintf("%s", s->protoname); if (s->vflag & INP_IPV4) - pos += xprintf("4"); + pos += xprintf("4 "); if (s->vflag & INP_IPV6) - pos += xprintf("6"); + pos += xprintf("6 "); while (pos < 36) pos += xprintf(" "); switch (s->family) {