Article View: comp.bugs.4bsd
Article #558ac.c (4.[23]bsd) merges output fields
From: jay
Date: Thu, 26 Feb 1987 05:35
Date: Thu, 26 Feb 1987 05:35
56 lines
1880 bytes
1880 bytes
Index: etc/ac.c 4.[23]BSD
Description:
If a user with an 8-char name is connected for 100 hours
or more, the name and time fields run together, breaking
awk scripts which expect every record to include 2 fields.
Repeat-By:
Give yourself an 8-char name, log on for 100.1 hours,
run /etc/ac.
Fix:
Add a space between the name and the time in 2 printf's
in function print().
*** /tmp/,RCSt1004938 Wed Feb 25 22:18:49 1987
--- ac.c Wed Feb 25 22:14:05 1987
***************
*** 1,4 ****
--- 1,5 ----
#ifndef lint
+ static char *rcsid = "$Header: ac.c,v 1.2 87/02/25 22:13:15 jay Exp $";
static char *sccsid = "@(#)ac.c 4.7 (Berkeley) 7/2/83";
#endif
/*
***************
*** 175,187 ****
if (t>0)
ttime += t;
if (pflag && ubuf[i].utime > 0) {
! printf("\t%-*.*s%6.2f\n", NMAX, NMAX,
ubuf[i].uname, ubuf[i].utime/3600.);
}
}
if (ttime > 0) {
pdate();
! printf("\ttotal%9.2f\n", ttime/3600.);
}
}
--- 176,188 ----
if (t>0)
ttime += t;
if (pflag && ubuf[i].utime > 0) {
! printf("\t%-*.*s %6.2f\n", NMAX, NMAX,
ubuf[i].uname, ubuf[i].utime/3600.);
}
}
if (ttime > 0) {
pdate();
! printf("\ttotal %9.2f\n", ttime/3600.);
}
}
--
Jay Plett
UUCP: {cmcl2,ihnp4}!lanl!unm-la!jay
{ucbvax,gatech}!unmvax!unm-la!jay
ARPA: jxyp@lanl
Technical Details
Message-ID:
<619@unm-la.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!cmcl2!beta!unm-la!jayShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!cmcl2!beta!unm-la!jay From: jay@unm-la.UUCP Newsgroups: comp.bugs.4bsd Subject: ac.c (4.[23]bsd) merges output fields Message-ID: <619@unm-la.UUCP> Date: Thu, 26-Feb-87 00:35:33 EST Article-I.D.: unm-la.619 Posted: Thu Feb 26 00:35:33 1987 Date-Received: Sat, 28-Feb-87 01:14:23 EST Organization: Univ. of New Mexico at Los Alamos Lines: 56 Keywords: bug ac.c awk