char logouttime[LAST_TIMESTAMP_LEN];
char length[LAST_TIMESTAMP_LEN];
char final[512];
- char utline[UT_LINESIZE+1];
+ char utline[sizeof(p->ut_line) + 1];
char domain[256];
char *s;
int mins, hours, days;
* uucp and ftp have special-type entries
*/
utline[0] = 0;
- strncat(utline, p->ut_line, UT_LINESIZE);
+ strncat(utline, p->ut_line, sizeof(p->ut_line));
if (strncmp(utline, "ftp", 3) == 0 && isdigit(utline[3]))
utline[3] = 0;
if (strncmp(utline, "uucp", 4) == 0 && isdigit(utline[4]))
if (ctl->show) {
char **walk;
for (walk = ctl->show; *walk; walk++) {
- if (strncmp(p->ut_user, *walk, UT_NAMESIZE) == 0 ||
+ if (strncmp(p->ut_user, *walk, sizeof(p->ut_user)) == 0 ||
strcmp(utline, *walk) == 0 ||
(strncmp(utline, "tty", 3) == 0 &&
strcmp(utline + 3, *walk) == 0)) break;
if (ctl->usedns || ctl->useip)
r = dns_lookup(domain, sizeof(domain), ctl->useip, p->ut_addr_v6);
if (r < 0) {
- len = UT_HOSTSIZE;
+ len = sizeof(p->ut_host);
if (len >= (int)sizeof(domain)) len = sizeof(domain) - 1;
domain[0] = 0;
strncat(domain, p->ut_host, len);
for (p = ulist; p; p = next) {
next = p->next;
if (strncmp(p->ut.ut_line, ut.ut_line,
- UT_LINESIZE) == 0) {
+ sizeof(ut.ut_line)) == 0) {
/* Show it */
if (c == 0) {
quit = list(ctl, &ut, p->ut.ut_tv.tv_sec, R_NORMAL);
ctl.until = (time_t) (p / 1000000);
break;
case 'w':
- if (ctl.name_len < UT_NAMESIZE)
- ctl.name_len = UT_NAMESIZE;
- if (ctl.domain_len < UT_HOSTSIZE)
- ctl.domain_len = UT_HOSTSIZE;
+ if (ctl.name_len < sizeof(((struct utmp *) 0)->ut_user))
+ ctl.name_len = sizeof(((struct utmp *) 0)->ut_user);
+ if (ctl.domain_len < sizeof(((struct utmp *) 0)->ut_host))
+ ctl.domain_len = sizeof(((struct utmp *) 0)->ut_host);
break;
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':