ret = rtrim_whitespace((unsigned char *) dst);
break;
case LAST_TIMEFTM_ISO8601:
- ret = strtime_iso(when, ISO_8601_DATE|ISO_8601_TIME|ISO_8601_TIMEZONE, dst, dlen);
+ ret = strtime_iso(when, ISO_TIMESTAMP_T, dst, dlen);
break;
default:
abort();
* uucp and ftp have special-type entries
*/
utline[0] = 0;
- strncat(utline, p->ut_line, sizeof(p->ut_line));
+ strncat(utline, p->ut_line, sizeof(utline) - 1);
if (strncmp(utline, "ftp", 3) == 0 && isdigit(utline[3]))
utline[3] = 0;
if (strncmp(utline, "uucp", 4) == 0 && isdigit(utline[4]))
r = -1;
if (ctl->usedns || ctl->useip)
r = dns_lookup(domain, sizeof(domain), ctl->useip, (int32_t*)p->ut_addr_v6);
- if (r < 0) {
- size_t sz = sizeof(p->ut_host);
-
- if (sz > sizeof(domain))
- sz = sizeof(domain);
-
- xstrncpy(domain, p->ut_host, sz);
- }
-
+ if (r < 0)
+ mem2strcpy(domain, p->ut_host, sizeof(p->ut_host), sizeof(domain));
if (ctl->showhost) {
if (!ctl->altlist) {
if (ut->ut_tv.tv_sec < ctl->boot_time.tv_sec)
return 1;
+ ut->ut_user[sizeof(ut->ut_user) - 1] = '\0';
pw = getpwnam(ut->ut_user);
if (!pw)
return 1;