From owner-freebsd-bugs Mon Apr 10 00:40:01 1995 Return-Path: bugs-owner Received: (from majordom@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id AAA00493 for bugs-outgoing; Mon, 10 Apr 1995 00:40:01 -0700 Received: (from gnats@localhost) by freefall.cdrom.com (8.6.10/8.6.6) id AAA00486 ; Mon, 10 Apr 1995 00:40:01 -0700 Date: Mon, 10 Apr 1995 00:40:01 -0700 Message-Id: <199504100740.AAA00486@freefall.cdrom.com> From: edward@edcom.com Reply-To: edward@edcom.com To: freebsd-bugs Subject: bin/330: lastcomm output format error In-Reply-To: Your message of Mon, 10 Apr 1995 00:36:37 -0700 <199504100736.AAA01425@edcom.com> Sender: bugs-owner@FreeBSD.org Precedence: bulk >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: