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
78 78
#define	MAXREALNAME	20
79 79
#define MAXHOSTNAME     17      /* in reality, hosts are never longer than 16 */
80 80
	(void)printf("%-*s %-*s%s  %s\n", MAXLOGNAME, "Login", MAXREALNAME,
81
	    "Name", " TTY  Idle  Login  Time ", (gflag) ? "" :
81
	    "Name", " TTY      Idle  Login  Time ", (gflag) ? "" :
82 82
	    oflag ? "Office  Phone" : "Where");
83 83

  
84 84
	for (sflag = R_FIRST;; sflag = R_NEXT) {
......
104 104
			(void)putchar(w->info == LOGGEDIN && !w->writable ?
105 105
			    '*' : ' ');
106 106
			if (*w->tty)
107
				(void)printf("%-3.3s ",
107
				(void)printf("%-7.7s ",
108 108
					     (strncmp(w->tty, "tty", 3)
109 109
					      && strncmp(w->tty, "cua", 3))
110 110
					     ? w->tty : w->tty + 3);
    (1-1/1)