svn commit: r187915 - head/usr.bin/sockstat

Dag-Erling Smorgrav des at FreeBSD.org
Fri Jan 30 06:28:51 PST 2009


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 <ighighi at gmail.com>
  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) {


More information about the svn-src-head mailing list