summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-08-08 03:07:15 +0000
committerache <ache@FreeBSD.org>1995-08-08 03:07:15 +0000
commitf8cf8863f08a6a1cbab0fc15973a57959c1c359a (patch)
tree142385dac92b68260fbcb40c5ee2be8eaa615f97 /gnu
parent89b1e701089efa633c6f6e59a3fdf2d863240374 (diff)
downloadFreeBSD-src-f8cf8863f08a6a1cbab0fc15973a57959c1c359a.zip
FreeBSD-src-f8cf8863f08a6a1cbab0fc15973a57959c1c359a.tar.gz
Replace ctime by strftime %c to use national representation
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/tar/list.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gnu/usr.bin/tar/list.c b/gnu/usr.bin/tar/list.c
index 470fc6b..28e6ab3 100644
--- a/gnu/usr.bin/tar/list.c
+++ b/gnu/usr.bin/tar/list.c
@@ -558,11 +558,11 @@ void
print_header ()
{
char modes[11];
- char *timestamp;
+ char timestamp[80];
char uform[11], gform[11]; /* These hold formatted ints */
char *user, *group;
char size[24]; /* Holds a formatted long or maj, min */
- time_t longie; /* To make ctime() call portable */
+ time_t longie;
int pad;
char *name;
extern long baserec;
@@ -641,7 +641,7 @@ print_header ()
/* Timestamp */
longie = hstat.st_mtime;
- timestamp = ctime (&longie);
+ strftime(timestamp, sizeof(timestamp), "%c", localtime(&longie));
timestamp[16] = '\0';
timestamp[24] = '\0';
OpenPOWER on IntegriCloud