summaryrefslogtreecommitdiffstats
path: root/usr.bin/rusers/rusers.c
diff options
context:
space:
mode:
authordillon <dillon@FreeBSD.org>2001-10-28 20:24:51 +0000
committerdillon <dillon@FreeBSD.org>2001-10-28 20:24:51 +0000
commitf6980904501c54598ac52a931d84511f55e00539 (patch)
treec4f468cb1c8f6cb0f697818b23cf578a508341f9 /usr.bin/rusers/rusers.c
parent3e277dbdb4c09f45f2b8c460917a89bca86d20e1 (diff)
downloadFreeBSD-src-f6980904501c54598ac52a931d84511f55e00539.zip
FreeBSD-src-f6980904501c54598ac52a931d84511f55e00539.tar.gz
Fix time_t == int assumption, properly convert protocol int to time_t.
Diffstat (limited to 'usr.bin/rusers/rusers.c')
-rw-r--r--usr.bin/rusers/rusers.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/rusers/rusers.c b/usr.bin/rusers/rusers.c
index 2322c98..a401bfa 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);
OpenPOWER on IntegriCloud