diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-04-16 18:57:40 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-04-16 18:57:40 +0000 |
commit | 6ee9a121a718e2b1724c426baf53f667621db4e5 (patch) | |
tree | 6e85858efec0de6bf084888659d90e5e0119226a /usr.bin/rwho | |
parent | edbe4873f35dfc0b0aaada8498757b8743fa471b (diff) |
cannot inspect out_name via a time_t pointer; ok guenther
Diffstat (limited to 'usr.bin/rwho')
-rw-r--r-- | usr.bin/rwho/rwho.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/rwho/rwho.c b/usr.bin/rwho/rwho.c index 63370265b35..a59c6f75678 100644 --- a/usr.bin/rwho/rwho.c +++ b/usr.bin/rwho/rwho.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rwho.c,v 1.16 2009/10/27 23:59:43 deraadt Exp $ */ +/* $OpenBSD: rwho.c,v 1.17 2013/04/16 18:57:39 deraadt Exp $ */ /* * Copyright (c) 1983 The Regents of the University of California. @@ -157,14 +157,16 @@ main(int argc, char **argv) mp = myutmp; for (i = 0; i < nusers; i++) { char buf[BUFSIZ], vis_user[4 * sizeof(mp->myutmp.out_name) + 1]; + time_t t; (void)snprintf(buf, sizeof(buf), "%s:%s", mp->myhost, mp->myutmp.out_line); strnvis(vis_user, mp->myutmp.out_name, sizeof vis_user, VIS_CSTYLE); + t = mp->myutmp.out_time; /* XXX 2038 */ printf("%-*.*s %-*s %.12s", UT_NAMESIZE, UT_NAMESIZE, vis_user, width, buf, - ctime((time_t *)&mp->myutmp.out_time)+4); + ctime(&t)+4); mp->myidle /= 60; if (mp->myidle) { if (aflg) { |