Do not use UT_LINESIZE or __UT_LINESIZE
These are not standard.
For more information see issue #279.
This fixes #279.
William Hubbs
5 years ago
36 | 36 | # define _PATH_DEV "/dev/" |
37 | 37 | #endif |
38 | 38 | |
39 | #ifndef UT_LINESIZE | |
40 | #define UT_LINESIZE __UT_LINESIZE | |
41 | #endif | |
42 | ||
43 | 39 | static sigjmp_buf jbuf; |
44 | 40 | |
45 | 41 | /* |
61 | 57 | uid_t uid; |
62 | 58 | char *tty; |
63 | 59 | static char uidbuf[32]; |
64 | static char ttynm[UT_LINESIZE + 4]; | |
60 | char *ttynm = NULL; | |
65 | 61 | |
66 | 62 | uid = getuid(); |
67 | 63 | if ((pwd = getpwuid(uid)) != NULL) { |
81 | 77 | if (tty[0] == '/') |
82 | 78 | tty++; |
83 | 79 | } |
84 | snprintf(ttynm, sizeof(ttynm), "(%.*s) ", | |
85 | UT_LINESIZE, tty); | |
86 | } else | |
87 | ttynm[0] = 0; | |
80 | xasprintf(&ttynm, "(%s) ", tty); | |
81 | } | |
88 | 82 | |
89 | 83 | *userp = uidbuf; |
90 | 84 | *ttyp = ttynm; |
155 | 149 | |
156 | 150 | xasprintf(&line, "\007\r\nBroadcast message from %s@%s %s(%s):\r\n\r\n", |
157 | 151 | user, name.nodename, tty, date); |
152 | free(tty); | |
158 | 153 | |
159 | 154 | /* |
160 | 155 | * Fork to avoid hanging in a write() |