diff options
author | ache <ache@FreeBSD.org> | 1995-08-08 00:38:33 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1995-08-08 00:38:33 +0000 |
commit | 6185a84ff12d758114e0c799c93a9ffde9071c37 (patch) | |
tree | a83b95059c248eeda1482919558ec5d18fffa0f3 | |
parent | b627d98084857dbef5e7f7c741b78f6d00b51625 (diff) | |
download | FreeBSD-src-6185a84ff12d758114e0c799c93a9ffde9071c37.zip FreeBSD-src-6185a84ff12d758114e0c799c93a9ffde9071c37.tar.gz |
Replace asctime/ctime by strftime %c to use national representation
-rw-r--r-- | usr.bin/finger/lprint.c | 13 | ||||
-rw-r--r-- | usr.bin/finger/sprint.c | 4 |
2 files changed, 9 insertions, 8 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); } diff --git a/usr.bin/finger/sprint.c b/usr.bin/finger/sprint.c index fdb3b6c..db1974d 100644 --- a/usr.bin/finger/sprint.c +++ b/usr.bin/finger/sprint.c @@ -60,7 +60,7 @@ sflag_print() register PERSON *pn; register WHERE *w; register int sflag, r; - register char *p; + char p[80]; DBT data, key; /* @@ -115,7 +115,7 @@ sflag_print() (void)printf(" "); } else (void)printf(" * "); - p = ctime(&w->loginat); + strftime(p, sizeof(p), "%c", localtime(&w->loginat)); #define SECSPERDAY 86400 #define DAYSPERWEEK 7 #define DAYSPERNYEAR 365 |