- crmsg = strncmp(bp->ut_name, "shutdown", NMAX) ? "crash" : "down ";
- if (!bp->ut_name[0])
- (void)strcpy(bp->ut_name, "reboot");
+ crmsg = strncmp(bp->ut_name, "shutdown",
+ UT_NAMESIZE) ? "crash" : "shutdown";
+ if (want(bp, NO)) {
+ ct = ctime(&bp->ut_time);
+ printf("%-*.*s %-*.*s %-*.*s %10.10s %5.5s \n",
+ UT_NAMESIZE, UT_NAMESIZE,
+ bp->ut_name, UT_LINESIZE,
+ UT_LINESIZE, bp->ut_line,
+ UT_HOSTSIZE, UT_HOSTSIZE,
+ bp->ut_host, ct, ct + 11);
+ if (maxrec != -1 && !--maxrec)
+ return;
+ }
+ continue;
+ }
+ /*
+ * if the line is '{' or '|', date got set; see
+ * utmp(5) for more info.
+ */
+ if ((bp->ut_line[0] == '{' || bp->ut_line[0] == '|')
+ && !bp->ut_line[1]) {