-/* $OpenBSD: who.c,v 1.32 2021/11/11 08:42:31 mestre Exp $ */
+/* $OpenBSD: who.c,v 1.33 2021/11/11 08:48:48 mestre Exp $ */
/* $NetBSD: who.c,v 1.4 1994/12/07 04:28:49 jtc Exp $ */
/*
if (show_term || show_idle) {
if (now == 0)
time(&now);
-
+
memset(line, 0, sizeof line);
strlcpy(line, _PATH_DEV, sizeof line);
strlcat(line, up->ut_line, sizeof line);
state = '?';
idle = 0;
}
-
}
(void)printf("%-*.*s ", NAME_WIDTH, UT_NAMESIZE, up->ut_name);
(void)printf("%.12s ", ctime(&up->ut_time) + 4);
if (show_idle) {
- if (idle < 60)
+ if (idle < 60)
(void)printf(" . ");
else if (idle < (24 * 60 * 60))
- (void)printf("%02d:%02d ",
+ (void)printf("%02d:%02d ",
((int)idle / (60 * 60)),
((int)idle % (60 * 60)) / 60);
else
(void)printf(" old ");
}
-
+
if (*up->ut_host)
printf(" (%.*s)", hostwidth, up->ut_host);
(void)putchar('\n');