From pete@ns.altadena.net  Thu Apr 16 18:10:56 1998
Received: from ns.altadena.net (ns.altadena.net [206.126.144.2])
          by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id SAA29997
          for <FreeBSD-gnats-submit@freebsd.org>; Thu, 16 Apr 1998 18:10:55 GMT
          (envelope-from pete@ns.altadena.net)
Received: (from pete@localhost)
	by ns.altadena.net (8.8.8/8.8.6) id LAA14989;
	Thu, 16 Apr 1998 11:10:51 -0700 (PDT)
Message-Id: <199804161810.LAA14989@ns.altadena.net>
Date: Thu, 16 Apr 1998 11:10:51 -0700 (PDT)
From: pete@altadena.net
Reply-To: pete@altadena.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: Heading fix for 'w' on long-name systems
X-Send-Pr-Version: 3.2

>Number:         6325
>Category:       bin
>Synopsis:       Heading fix for 'w' on long-name systems
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Apr 16 11:20:01 PDT 1998
>Closed-Date:    Thu May 21 01:47:15 PDT 1998
>Last-Modified:  Thu May 21 01:48:07 PDT 1998
>Originator:     Pete Carah
>Release:        FreeBSD 2.2.6-STABLE i386
>Organization:
Altadena Internet Communications
>Environment:

	Any system based on 2.x which has been recompiled for user
	names longer than 8 characters

>Description:

	w adjusted the user-name size for detail lines but not the
	header.  Enclosed diff fixes this.  (this should apply against
	any 2.x-stable; may alsp apply to -current (I haven't looked
	to see if it has been fixed there))

>How-To-Repeat:

	w
	(on any 2.x system with usernames > 8 chars)

>Fix:

*** w.c.orig	Tue Apr 14 09:52:43 1998
--- w.c	Tue Apr 14 09:56:11 1998
***************
*** 245,253 ****
  		if (wcmd == 0)
  			exit (0);
  
! #define HEADER	"USER     TTY FROM              LOGIN@  IDLE WHAT\n"
! #define WUSED	(sizeof (HEADER) - sizeof ("WHAT\n"))
! 		(void)printf(HEADER);
  	}
  
  	if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL)
--- 245,256 ----
  		if (wcmd == 0)
  			exit (0);
  
! #define HEADER1	"USER"
! #define HEADER2 "TTY FROM              LOGIN@  IDLE WHAT\n"
! #define WUSED	(sizeof (HEADER1) + sizeof(HEADER2) + 1 + UT_NAMESIZE - \
! 				 sizeof ("WHAT\n"))
! 		(void)printf("%-*.*s %s", UT_NAMESIZE, UT_NAMESIZE, HEADER1,
! 				HEADER2);
  	}
  
  	if ((kp = kvm_getprocs(kd, KERN_PROC_ALL, 0, &nentries)) == NULL)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: jkoshy 
State-Changed-When: Thu May 21 01:47:15 PDT 1998 
State-Changed-Why:  
Rev 1.27 of usr.bin/w/w.c has a generalized fix for this problem. 
>Unformatted:
