summaryrefslogtreecommitdiffstats
path: root/usr.bin/finger/lprint.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-08-08 00:38:33 +0000
committerache <ache@FreeBSD.org>1995-08-08 00:38:33 +0000
commit6185a84ff12d758114e0c799c93a9ffde9071c37 (patch)
treea83b95059c248eeda1482919558ec5d18fffa0f3 /usr.bin/finger/lprint.c
parentb627d98084857dbef5e7f7c741b78f6d00b51625 (diff)
downloadFreeBSD-src-6185a84ff12d758114e0c799c93a9ffde9071c37.zip
FreeBSD-src-6185a84ff12d758114e0c799c93a9ffde9071c37.tar.gz
Replace asctime/ctime by strftime %c to use national representation
Diffstat (limited to 'usr.bin/finger/lprint.c')
-rw-r--r--usr.bin/finger/lprint.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/finger/lprint.c b/usr.bin/finger/lprint.c
index 28a9be7..83aa5c08 100644
--- a/usr.bin/finger/lprint.c
+++ b/usr.bin/finger/lprint.c
@@ -103,7 +103,8 @@ lprint(pn)
register int cpr, len, maxlen;
struct tm *tp;
int oddfield;
- char *t, *tzn;
+ char *tzn;
+ char t[80];
/*
* long format --
@@ -170,7 +171,7 @@ lprint(pn)
switch (w->info) {
case LOGGEDIN:
tp = localtime(&w->loginat);
- t = asctime(tp);
+ strftime(t, sizeof(t), "%c", tp);
tzn = tp->tm_zone;
cpr = printf("On since %.16s (%s) on %s",
t, tzn, w->tty);
@@ -204,7 +205,7 @@ lprint(pn)
break;
}
tp = localtime(&w->loginat);
- t = asctime(tp);
+ strftime(t, sizeof(t), "%c", tp);
tzn = tp->tm_zone;
if (now - w->loginat > 86400 * 365 / 2)
cpr =
@@ -226,16 +227,16 @@ lprint(pn)
printf("No Mail.\n");
else if (pn->mailrecv > pn->mailread) {
tp = localtime(&pn->mailrecv);
- t = asctime(tp);
+ strftime(t, sizeof(t), "%c", tp);
tzn = tp->tm_zone;
printf("New mail received %.16s %.4s (%s)\n", t, t + 20, tzn);
tp = localtime(&pn->mailread);
- t = asctime(tp);
+ strftime(t, sizeof(t), "%c", tp);
tzn = tp->tm_zone;
printf(" Unread since %.16s %.4s (%s)\n", t, t + 20, tzn);
} else {
tp = localtime(&pn->mailread);
- t = asctime(tp);
+ strftime(t, sizeof(t), "%c", tp);
tzn = tp->tm_zone;
printf("Mail last read %.16s %.4s (%s)\n", t, t + 20, tzn);
}
OpenPOWER on IntegriCloud