summaryrefslogtreecommitdiffstats
path: root/usr.bin/who
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-08-07 23:39:58 +0000
committerache <ache@FreeBSD.org>1995-08-07 23:39:58 +0000
commit97b1928185ecb87b45ef960f34d4947a5846a746 (patch)
tree0deef80783ee604be6840ac092e16e8d3bfe5d30 /usr.bin/who
parent09e180572a3268865d0e842596ad3016d701e43c (diff)
downloadFreeBSD-src-97b1928185ecb87b45ef960f34d4947a5846a746.zip
FreeBSD-src-97b1928185ecb87b45ef960f34d4947a5846a746.tar.gz
Replace ctime by strftime %c to use national date representation now
Diffstat (limited to 'usr.bin/who')
-rw-r--r--usr.bin/who/who.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/who/who.c b/usr.bin/who/who.c
index d1e6eb9..77a131c 100644
--- a/usr.bin/who/who.c
+++ b/usr.bin/who/who.c
@@ -46,7 +46,7 @@ static char sccsid[] = "@(#)who.c 8.1 (Berkeley) 6/6/93";
#include <sys/types.h>
#include <sys/file.h>
-#include <sys/time.h>
+#include <time.h>
#include <pwd.h>
#include <utmp.h>
#include <stdio.h>
@@ -60,7 +60,6 @@ main(argc, argv)
struct passwd *pw;
FILE *ufp, *file();
char *t, *rindex(), *strcpy(), *strncpy(), *ttyname();
- time_t time();
switch (argc) {
case 1: /* who */
@@ -109,11 +108,12 @@ main(argc, argv)
output(up)
struct utmp *up;
{
- char *ctime();
+ char buf[80];
(void)printf("%-*.*s %-*.*s", UT_NAMESIZE, UT_NAMESIZE, up->ut_name,
UT_LINESIZE, UT_LINESIZE, up->ut_line);
- (void)printf("%.12s", ctime(&up->ut_time) + 4);
+ (void)strftime(buf, sizeof(buf), "%c", localtime(&up->ut_time));
+ (void)printf("%.12s", buf + 4);
if (*up->ut_host)
printf("\t(%.*s)", UT_HOSTSIZE, up->ut_host);
(void)putchar('\n');
OpenPOWER on IntegriCloud