summaryrefslogtreecommitdiffstats
path: root/usr.bin/rwho
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-08-08 00:15:16 +0000
committerache <ache@FreeBSD.org>1995-08-08 00:15:16 +0000
commitb627d98084857dbef5e7f7c741b78f6d00b51625 (patch)
treeadbff60721be6c549834f460f562e7ca53f2fab6 /usr.bin/rwho
parent36623ef62d5001916b6d1da837f2959dad09c73a (diff)
downloadFreeBSD-src-b627d98084857dbef5e7f7c741b78f6d00b51625.zip
FreeBSD-src-b627d98084857dbef5e7f7c741b78f6d00b51625.tar.gz
Change ctime to strftime %c to use national date/time representation.
Diffstat (limited to 'usr.bin/rwho')
-rw-r--r--usr.bin/rwho/rwho.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/rwho/rwho.c b/usr.bin/rwho/rwho.c
index ef10751..c7f8398 100644
--- a/usr.bin/rwho/rwho.c
+++ b/usr.bin/rwho/rwho.c
@@ -46,6 +46,8 @@ static char sccsid[] = "@(#)rwho.c 8.1 (Berkeley) 6/6/93";
#include <sys/file.h>
#include <protocols/rwhod.h>
#include <stdio.h>
+#include <time.h>
+#include <string.h>
DIR *dirp;
@@ -65,7 +67,6 @@ int nusers;
*/
#define down(w,now) ((now) - (w)->wd_recvtime > 11 * 60)
-char *ctime(), *strcpy();
time_t now;
int aflg;
@@ -144,13 +145,14 @@ main(argc, argv)
}
mp = myutmp;
for (i = 0; i < nusers; i++) {
- char buf[BUFSIZ];
+ char buf[BUFSIZ], cbuf[80];
+ strftime(cbuf, sizeof(cbuf), "%c", localtime((time_t *)&mp->myutmp.out_time));
(void)sprintf(buf, "%s:%-.8s", mp->myhost, mp->myutmp.out_line);
printf("%-8.8s %-*s %.12s",
mp->myutmp.out_name,
width,
buf,
- ctime((time_t *)&mp->myutmp.out_time)+4);
+ cbuf + 4);
mp->myidle /= 60;
if (mp->myidle) {
if (aflg) {
OpenPOWER on IntegriCloud