mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 09:10:28 +00:00
Fix time_t == int assumption, properly convert protocol int to time_t.
This commit is contained in:
parent
9ef76b94a7
commit
91d37f1692
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85638
|
@ -115,9 +115,8 @@ rusers_reply(caddr_t replyp, struct sockaddr_in *raddrp)
|
|||
printf("%-*s ", HOST_WIDTH, host);
|
||||
|
||||
for (x = 0; x < up->utmpidlearr_len; x++) {
|
||||
strncpy(date,
|
||||
&(ctime((time_t *)&(up->utmpidlearr_val[x].ui_utmp.ut_time))[4]),
|
||||
sizeof(date) - 1);
|
||||
time_t t = int_to_time(up->utmpidlearr_val[x].ui_utmp.ut_time);
|
||||
strncpy(date, &(ctime(&t)[4]), sizeof(date) - 1);
|
||||
|
||||
idle = up->utmpidlearr_val[x].ui_idle;
|
||||
sprintf(idle_time, " :%02d", idle);
|
||||
|
|
Loading…
Reference in a new issue