1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-11-28 08:02:54 +00:00

Fix time_t == int assumption, properly convert protocol int to time_t.

This commit is contained in:
Matthew Dillon 2001-10-28 20:24:51 +00:00
parent 9ef76b94a7
commit 91d37f1692
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85638

View File

@ -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);