Project

General

Profile

Submit #3256 ยป 0001-finger-widen-TTY-field-to-avoid-truncation.patch

dancrossnyc, 01/11/2021 05:26 AM

View differences:

usr.bin/finger/sprint.c
#define MAXREALNAME 20
#define MAXHOSTNAME 17 /* in reality, hosts are never longer than 16 */
(void)printf("%-*s %-*s%s %s\n", MAXLOGNAME, "Login", MAXREALNAME,
"Name", " TTY Idle Login Time ", (gflag) ? "" :
"Name", " TTY Idle Login Time ", (gflag) ? "" :
oflag ? "Office Phone" : "Where");
for (sflag = R_FIRST;; sflag = R_NEXT) {
......
(void)putchar(w->info == LOGGEDIN && !w->writable ?
'*' : ' ');
if (*w->tty)
(void)printf("%-3.3s ",
(void)printf("%-7.7s ",
(strncmp(w->tty, "tty", 3)
&& strncmp(w->tty, "cua", 3))
? w->tty : w->tty + 3);
    (1-1/1)