version 1.33, 2001/05/30 20:57:58 |
version 1.34, 2001/07/12 05:17:31 |
|
|
} |
} |
} |
} |
|
|
if (!nflag) |
if (!nflag) { |
if (gethostname(domain, sizeof(domain) - 1) < 0 || |
if (gethostname(domain, sizeof(domain) - 1) < 0 || |
(p = strchr(domain, '.')) == 0) |
(p = strchr(domain, '.')) == 0) |
domain[0] = '\0'; |
domain[0] = '\0'; |
|
|
domain[sizeof(domain) - 1] = '\0'; |
domain[sizeof(domain) - 1] = '\0'; |
memmove(domain, p, strlen(p) + 1); |
memmove(domain, p, strlen(p) + 1); |
} |
} |
|
} |
|
|
for (ep = ehead; ep != NULL; ep = ep->next) { |
for (ep = ehead; ep != NULL; ep = ep->next) { |
p = *ep->utmp.ut_host ? ep->utmp.ut_host : "-"; |
p = *ep->utmp.ut_host ? ep->utmp.ut_host : "-"; |
|
|
} |
} |
if (x) { |
if (x) { |
(void)snprintf(buf, sizeof(buf), "%s:%.*s", p, |
(void)snprintf(buf, sizeof(buf), "%s:%.*s", p, |
ep->utmp.ut_host + UT_HOSTSIZE - x, x); |
(int)(ep->utmp.ut_host + UT_HOSTSIZE - x), x); |
p = buf; |
p = buf; |
} |
} |
(void)printf("%-*.*s %-2.2s %-*.*s ", |
(void)printf("%-*.*s %-2.2s %-*.*s ", |