diff options
author | dillon <dillon@FreeBSD.org> | 2001-10-28 20:24:51 +0000 |
---|---|---|
committer | dillon <dillon@FreeBSD.org> | 2001-10-28 20:24:51 +0000 |
commit | f6980904501c54598ac52a931d84511f55e00539 (patch) | |
tree | c4f468cb1c8f6cb0f697818b23cf578a508341f9 /usr.bin/rusers | |
parent | 3e277dbdb4c09f45f2b8c460917a89bca86d20e1 (diff) | |
download | FreeBSD-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')
-rw-r--r-- | usr.bin/rusers/rusers.c | 5 |
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); |