Skip to content

Commit 8e1e8ec

Browse files
committed
Fix for 32-bit architectures
1 parent 4922e67 commit 8e1e8ec

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

timezones.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,9 @@ func buildTZData(template *Template) ([]byte, error) {
9494
if len(template.Zones) == 0 && template.Extend == "" {
9595
return nil, fmt.Errorf("either zones or extend string need to be present")
9696
}
97-
if len(template.Changes) > math.MaxUint32 {
98-
return nil, fmt.Errorf("too many changes (%d), max is %d", len(template.Changes), math.MaxUint32)
97+
nchanges := int64(len(template.Changes))
98+
if nchanges > math.MaxUint32 {
99+
return nil, fmt.Errorf("too many changes (%d), max is %v", nchanges, int64(math.MaxUint32))
99100
}
100101

101102
size := headerSize + // v1 header + empty v1 data block

0 commit comments

Comments
 (0)