summaryrefslogtreecommitdiffstats
path: root/src/ar.c
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2019-01-09 13:57:31 +0100
committerUlf Hermann <[email protected]>2019-01-09 13:57:31 +0100
commitbc774f62436c4fe5082f0a70c6620fa0fdf823a9 (patch)
tree07963f45b2cdaccf12281712e2eef179dbce1fee /src/ar.c
parent5da108a40dd24c7d3e4183ec9ae1904bb3f01575 (diff)
parent4ea9a2db164caadf836a65d5cdffb09a2d5a37ce (diff)
Merge tag 'elfutils-0.175'
elfutils 0.175 release Change-Id: I409f41767af349d0521351dd733879ad31c65aab
Diffstat (limited to 'src/ar.c')
-rw-r--r--src/ar.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ar.c b/src/ar.c
index 44edbd35..7634d318 100644
--- a/src/ar.c
+++ b/src/ar.c
@@ -519,8 +519,14 @@ do_oper_extract (int oper, const char *arfname, char **argv, int argc,
else if (oper == oper_list)
{
char datestr[100];
- strftime (datestr, sizeof (datestr), "%b %d %H:%M %Y",
- localtime (&arhdr->ar_date));
+ struct tm *tp = localtime (&arhdr->ar_date);
+ if (tp == NULL)
+ {
+ time_t time = 0;
+ tp = localtime (&time);
+ }
+
+ strftime (datestr, sizeof (datestr), "%b %d %H:%M %Y", tp);
printf ("%c%c%c%c%c%c%c%c%c %u/%u %6ju %s %s\n",
(arhdr->ar_mode & S_IRUSR) ? 'r' : '-',