Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Apr 1995 00:40:01 -0700
From:      edward@edcom.com
To:        freebsd-bugs
Subject:   bin/330: lastcomm output format error
Message-ID:  <199504100740.AAA00486@freefall.cdrom.com>
In-Reply-To: Your message of Mon, 10 Apr 1995 00:36:37 -0700 <199504100736.AAA01425@edcom.com>

next in thread | previous in thread | raw e-mail | index | archive | help

>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:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 10 00:40:00 1995
>Originator:     Edward Wang
>Organization:
unix guru inc.
>Release:        FreeBSD 2.1.0-Development i386
>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));

>Audit-Trail:
>Unformatted:





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199504100740.AAA00486>