Skip to content

Commit 9ed18eb

Browse files
authored
Merge pull request #55 from lwch/dev
修正32位系统下的整数溢出问题
2 parents a690103 + 0477bd0 commit 9ed18eb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

code/utils/utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ func BuildDir(dir, u string) {
1414
if len(u) > 0 {
1515
us, err := user.Lookup(u)
1616
runtime.Assert(err)
17-
uid, _ := strconv.ParseInt(us.Uid, 10, 64)
18-
gid, _ := strconv.ParseInt(us.Gid, 10, 64)
17+
uid, _ := strconv.ParseInt(us.Uid, 10, 32)
18+
gid, _ := strconv.ParseInt(us.Gid, 10, 32)
1919
runtime.Assert(os.Chown(dir, int(uid), int(gid)))
2020
}
2121
}

0 commit comments

Comments
 (0)