prevent truncation of 64-bit values on 32-bit platforms (#5902)

This commit is contained in:
Alessandro Ros
2026-06-28 11:37:14 +02:00
committed by GitHub
parent ed5496f607
commit 7eb5d30075
2 changed files with 10 additions and 10 deletions
+1 -1
View File
@@ -201,7 +201,7 @@ func loadEnvInternal(env map[string]string, prefix string, prv reflect.Value) er
vals := make([]uint, len(raw))
for i, v := range raw {
tmp, err := strconv.ParseUint(v, 10, 64)
tmp, err := strconv.ParseUint(v, 10, 32)
if err != nil {
return err
}
+9 -9
View File
@@ -57,8 +57,8 @@ func timeLocationDecode(s string) *time.Location {
sign = -1
}
v1, _ := strconv.ParseInt(s[1:3], 10, 64)
v2, _ := strconv.ParseInt(s[3:5], 10, 64)
v1, _ := strconv.ParseInt(s[1:3], 10, 32)
v2, _ := strconv.ParseInt(s[3:5], 10, 32)
off := sign * (int(v1)*3600 + int(v2)*60)
@@ -202,31 +202,31 @@ func (p *Path) Decode(format string, v string) bool {
p.Path = v
case "%Y":
tmp, _ := strconv.ParseInt(v, 10, 64)
tmp, _ := strconv.ParseInt(v, 10, 32)
year = int(tmp)
case "%m":
tmp, _ := strconv.ParseInt(v, 10, 64)
tmp, _ := strconv.ParseInt(v, 10, 32)
month = time.Month(int(tmp))
case "%d":
tmp, _ := strconv.ParseInt(v, 10, 64)
tmp, _ := strconv.ParseInt(v, 10, 32)
day = int(tmp)
case "%H":
tmp, _ := strconv.ParseInt(v, 10, 64)
tmp, _ := strconv.ParseInt(v, 10, 32)
hour = int(tmp)
case "%M":
tmp, _ := strconv.ParseInt(v, 10, 64)
tmp, _ := strconv.ParseInt(v, 10, 32)
minute = int(tmp)
case "%S":
tmp, _ := strconv.ParseInt(v, 10, 64)
tmp, _ := strconv.ParseInt(v, 10, 32)
second = int(tmp)
case "%f":
tmp, _ := strconv.ParseInt(v, 10, 64)
tmp, _ := strconv.ParseInt(v, 10, 32)
micros = int(tmp)
case "%z":