Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site tellab3.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!ihnp4!tellab1!tellab2!tellab3!steve From: steve@tellab3.UUCP (Steve Harpster) Newsgroups: net.bugs.4bsd Subject: Sa -u prints garbage Message-ID: <205@tellab3.UUCP> Date: Thu, 23-Aug-84 11:41:58 EDT Article-I.D.: tellab3.205 Posted: Thu Aug 23 11:41:58 1984 Date-Received: Fri, 24-Aug-84 04:45:33 EDT Organization: Tellabs, Inc., Lisle, Ill. Lines: 58 Subject: Sa produces garbage with -u option Index: etc/sa 4.2BSD (fix) Description: The option -u on sa produces bogus numbers and commands. Repeat-By: /etc/sa -u Fix: The problem is with a printf() thinking that its arguments are of a different type then what they really are. Casts correct the problem. I also added in group id's as well. Diffs follow: *** oldsa.c Thu Aug 23 10:16:04 1984 --- sa.c Thu Aug 23 10:21:35 1984 *************** *** 633,638 y = fbuf.ac_mem; z = expand(fbuf.ac_io); if (uflg) { printf("%3d%6.1fcp %6dmem %6dio %.14s\n", fbuf.ac_uid, x, y, z, fbuf.ac_comm); continue; --- 633,643 ----- y = fbuf.ac_mem; z = expand(fbuf.ac_io); if (uflg) { + #ifdef TELLABS3 + printf("%3duid%6dgid%6.1fcp %6dmem %6dio %.14s\n", + fbuf.ac_uid, fbuf.ac_gid, (float) x, (int) y, + (int) z, fbuf.ac_comm); + #else printf("%3d%6.1fcp %6dmem %6dio %.14s\n", fbuf.ac_uid, x, y, z, fbuf.ac_comm); #endif *************** *** 635,640 if (uflg) { printf("%3d%6.1fcp %6dmem %6dio %.14s\n", fbuf.ac_uid, x, y, z, fbuf.ac_comm); continue; } up = finduser(fbuf.ac_uid); --- 640,646 ----- #else printf("%3d%6.1fcp %6dmem %6dio %.14s\n", fbuf.ac_uid, x, y, z, fbuf.ac_comm); + #endif continue; } up = finduser(fbuf.ac_uid); -- ...ihnp4!tellab1!steve Steve Harpster Tellabs, Inc.