From edward@edcom.com  Mon Apr 10 00:36:44 1995
Received: from edcom.com (edcom.com [140.174.173.185])
          by freefall.cdrom.com (8.6.10/8.6.6) with ESMTP id AAA00402
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 10 Apr 1995 00:36:43 -0700
Received: (from edward@localhost) by edcom.com (8.6.11/8.6.9) id AAA01425; Mon, 10 Apr 1995 00:36:37 -0700
Message-Id: <199504100736.AAA01425@edcom.com>
Date: Mon, 10 Apr 1995 00:36:37 -0700
From: edward@edcom.com
Reply-To: edward@edcom.com
To: FreeBSD-gnats-submit@freebsd.org
Subject: lastcomm output format error
X-Send-Pr-Version: 3.2

>Number:         330
>Category:       bin
>Synopsis:       lastcomm outputs garbage when command name is 10 chars long
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs (FreeBSD bugs mailing list)
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 10 00:40:00 1995
>Closed-Date:    Tue Apr 11 11:51:04 PDT 1995
>Last-Modified:
>Originator:     Edward Wang
>Release:        FreeBSD 2.1.0-Development i386
>Organization:
unix guru inc.
>Environment:

	2.0-950322-SNAP release

>Description:

	the printf format string for lastcomm is incorrect
	causing garbage output on lines with command names of 10 chars

>How-To-Repeat:

	lastcomm | more
	and look for something long

>Fix:
	
*** lastcomm.c.dist	Fri May 27 05:31:57 1994
--- lastcomm.c	Mon Apr 10 00:29:57 1995
***************
*** 135,142 ****
  			continue;
  
  		t = expand(ab.ac_utime) + expand(ab.ac_stime);
! 		(void)printf("%-*s %-7s %-*s %-*s %6.2f secs %.16s\n",
! 			fldsiz(acct, ac_comm), ab.ac_comm, flagbits(ab.ac_flag),
  			UT_NAMESIZE, user_from_uid(ab.ac_uid, 0),
  			UT_LINESIZE, getdev(ab.ac_tty),
  			t / (double)AHZ, ctime(&ab.ac_btime));
--- 135,143 ----
  			continue;
  
  		t = expand(ab.ac_utime) + expand(ab.ac_stime);
! 		(void)printf("%-*.*s %-7s %-*s %-*s %6.2f secs %.16s\n",
! 			fldsiz(acct, ac_comm), fldsiz(acct, ac_comm),
! 			ab.ac_comm, flagbits(ab.ac_flag),
  			UT_NAMESIZE, user_from_uid(ab.ac_uid, 0),
  			UT_LINESIZE, getdev(ab.ac_tty),
  			t / (double)AHZ, ctime(&ab.ac_btime));

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: ache 
State-Changed-When: Tue Apr 11 11:51:04 PDT 1995 
State-Changed-Why:  
Fix applied. 
>Unformatted:



