From 5281869fac4abd538aa3fbcadf3001c26bcd0aff Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Wed, 11 Nov 2009 11:19:33 -0800 Subject: [PATCH] gopack: convert long to time_t before taking a pointer. Fixes #40. R=rsc, r1 CC=golang-dev https://golang.org/cl/154057 --- src/cmd/gopack/ar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd/gopack/ar.c b/src/cmd/gopack/ar.c index a46859486d2..b8e5cdd317c 100644 --- a/src/cmd/gopack/ar.c +++ b/src/cmd/gopack/ar.c @@ -1215,11 +1215,13 @@ void longt(Armember *bp) { char *cp; + time_t date; pmode(strtoul(bp->hdr.mode, 0, 8)); Bprint(&bout, "%3ld/%1ld", strtol(bp->hdr.uid, 0, 0), strtol(bp->hdr.gid, 0, 0)); Bprint(&bout, "%7ld", bp->size); - cp = ctime(&bp->date); + date = bp->date; + cp = ctime(&date); Bprint(&bout, " %-12.12s %-4.4s ", cp+4, cp+24); }