diff options
author | phk <phk@FreeBSD.org> | 2000-10-22 17:38:32 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2000-10-22 17:38:32 +0000 |
commit | 7fb21cfd3902c8f5069b93bb100a2a259de084d5 (patch) | |
tree | a73ac759c75fcd7da89ae3619932c4d73c6eaade /usr.bin/lastcomm | |
parent | 61ceeec191876fad29711529958f6325d64a2b46 (diff) | |
download | FreeBSD-src-7fb21cfd3902c8f5069b93bb100a2a259de084d5.zip FreeBSD-src-7fb21cfd3902c8f5069b93bb100a2a259de084d5.tar.gz |
Avoid using the semi-bogus include <struct.h>
All uses of fldsiz() in this file were wrong anyway.
Diffstat (limited to 'usr.bin/lastcomm')
-rw-r--r-- | usr.bin/lastcomm/lastcomm.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.bin/lastcomm/lastcomm.c b/usr.bin/lastcomm/lastcomm.c index 4beed14..595e80e 100644 --- a/usr.bin/lastcomm/lastcomm.c +++ b/usr.bin/lastcomm/lastcomm.c @@ -55,7 +55,6 @@ static const char rcsid[] = #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <struct.h> #include <unistd.h> #include <utmp.h> #include "pathnames.h" @@ -171,15 +170,14 @@ main(argc, argv) ab.ac_comm[1] = '\0'; } else for (p = &ab.ac_comm[0]; - p < &ab.ac_comm[fldsiz(acct, ac_comm)] && *p; ++p) + p < &ab.ac_comm[AC_COMM_LEN] && *p; ++p) if (!isprint(*p)) *p = '?'; if (*argv && !requested(argv, &ab)) continue; (void)printf("%-*.*s %-7s %-*s %-*s ", - fldsiz(acct, ac_comm), - fldsiz(acct, ac_comm), ab.ac_comm, + AC_COMM_LEN, AC_COMM_LEN, ab.ac_comm, flagbits(ab.ac_flag), UT_NAMESIZE, user_from_uid(ab.ac_uid, 0), UT_LINESIZE, getdev(ab.ac_tty)); @@ -271,7 +269,7 @@ requested(argv, acp) return (1); if ((p = getdev(acp->ac_tty)) && !strcmp(p, *argv)) return (1); - if (!strncmp(acp->ac_comm, *argv, fldsiz(acct, ac_comm))) + if (!strncmp(acp->ac_comm, *argv, AC_COMM_LEN)) return (1); } while (*++argv); return (0); |