[BACK]Return to lastcomm.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / lastcomm

Diff for /src/usr.bin/lastcomm/lastcomm.c between version 1.23 and 1.24

version 1.23, 2015/10/09 01:37:08 version 1.24, 2017/03/11 18:33:21
Line 41 
Line 41 
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
 #include <struct.h>  
 #include <unistd.h>  #include <unistd.h>
 #include <utmp.h>  #include <utmp.h>
 #include <pwd.h>  #include <pwd.h>
Line 116 
Line 115 
                         ab.ac_comm[1] = '\0';                          ab.ac_comm[1] = '\0';
                 } else                  } else
                         for (p = &ab.ac_comm[0];                          for (p = &ab.ac_comm[0];
                             p < &ab.ac_comm[fldsiz(acct, ac_comm)] && *p; ++p)                              p < &ab.ac_comm[sizeof ab.ac_comm] && *p; ++p)
                                 if (!isprint((unsigned char)*p))                                  if (!isprint((unsigned char)*p))
                                         *p = '?';                                          *p = '?';
                 if (!*argv || requested(argv, &ab))                  if (!*argv || requested(argv, &ab))
                 {                  {
                         t = expand(ab.ac_utime) + expand(ab.ac_stime);                          t = expand(ab.ac_utime) + expand(ab.ac_stime);
                         (void)printf("%-*.*s %-7s %-*.*s %-*.*s %6.2f secs %.16s",                          (void)printf("%-*.*s %-7s %-*.*s %-*.*s %6.2f secs %.16s",
                             (int)fldsiz(acct, ac_comm),                              (int)sizeof ab.ac_comm,
                             (int)fldsiz(acct, ac_comm),                              (int)sizeof ab.ac_comm,
                             ab.ac_comm, flagbits(ab.ac_flag), UT_NAMESIZE,                              ab.ac_comm, flagbits(ab.ac_flag), UT_NAMESIZE,
                             UT_NAMESIZE, user_from_uid(ab.ac_uid, 0),                              UT_NAMESIZE, user_from_uid(ab.ac_uid, 0),
                             UT_LINESIZE, UT_LINESIZE, getdev(ab.ac_tty),                              UT_LINESIZE, UT_LINESIZE, getdev(ab.ac_tty),
Line 186 
Line 185 
                         return (1);                          return (1);
                 if (!strcmp(getdev(acp->ac_tty), *argv))                  if (!strcmp(getdev(acp->ac_tty), *argv))
                         return (1);                          return (1);
                 if (!strncmp(acp->ac_comm, *argv, fldsiz(acct, ac_comm)))                  if (!strncmp(acp->ac_comm, *argv, sizeof acp->ac_comm))
                         return (1);                          return (1);
         } while (*++argv);          } while (*++argv);
         return (0);          return (0);

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24