Commit edce6349 authored by Russ Cox's avatar Russ Cox

time: prepare for 64-bit ints

The code was trying to interpret a uint32 n as a signed quantity
and then store it in an int. For this, int(n) currently works, but when
int becomes 64 bits one must write int(int32(n)) instead, to get
the 32-bit sign extension.

Update #2188.

R=golang-dev, nigeltao
CC=golang-dev
https://golang.org/cl/6551068
parent 5d50dbc5
...@@ -141,7 +141,7 @@ func loadZoneData(bytes []byte) (l *Location, err error) { ...@@ -141,7 +141,7 @@ func loadZoneData(bytes []byte) (l *Location, err error) {
if n, ok = zonedata.big4(); !ok { if n, ok = zonedata.big4(); !ok {
return nil, badData return nil, badData
} }
zone[i].offset = int(n) zone[i].offset = int(int32(n))
var b byte var b byte
if b, ok = zonedata.byte(); !ok { if b, ok = zonedata.byte(); !ok {
return nil, badData return nil, badData
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment