Skip to content

Commit 5281869

Browse files
committed
gopack: convert long to time_t before taking a pointer.
Fixes #40. R=rsc, r1 CC=golang-dev https://golang.org/cl/154057
1 parent 7f48606 commit 5281869

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cmd/gopack/ar.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -1215,11 +1215,13 @@ void
12151215
longt(Armember *bp)
12161216
{
12171217
char *cp;
1218+
time_t date;
12181219

12191220
pmode(strtoul(bp->hdr.mode, 0, 8));
12201221
Bprint(&bout, "%3ld/%1ld", strtol(bp->hdr.uid, 0, 0), strtol(bp->hdr.gid, 0, 0));
12211222
Bprint(&bout, "%7ld", bp->size);
1222-
cp = ctime(&bp->date);
1223+
date = bp->date;
1224+
cp = ctime(&date);
12231225
Bprint(&bout, " %-12.12s %-4.4s ", cp+4, cp+24);
12241226
}
12251227

0 commit comments

Comments
 (0)