From 91d37f1692fd242cfe058aede398ddff112e06e7 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sun, 28 Oct 2001 20:24:51 +0000 Subject: [PATCH] Fix time_t == int assumption, properly convert protocol int to time_t. --- usr.bin/rusers/rusers.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr.bin/rusers/rusers.c b/usr.bin/rusers/rusers.c index 2322c98b26ef..a401bfa6e055 100644 --- a/usr.bin/rusers/rusers.c +++ b/usr.bin/rusers/rusers.c @@ -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);