Skip to content

Commit f9ec2ea

Browse files
committed
Fix overflow bug
1 parent 4875667 commit f9ec2ea

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

googletts/token.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ func getTTSKeyFromHTML() (key1, key2 int64, err error) {
4242
if len(matchList) != 4 {
4343
return 0, 0, fmt.Errorf("HTML parse error")
4444
}
45-
part1, _ := strconv.Atoi(matchList[1])
46-
part2, _ := strconv.Atoi(matchList[2])
47-
part3, _ := strconv.Atoi(matchList[3])
45+
part1, _ := strconv.ParseInt(matchList[1], 10, 64)
46+
part2, _ := strconv.ParseInt(matchList[2], 10, 64)
47+
part3, _ := strconv.ParseInt(matchList[3], 10, 64)
4848

49-
return int64(part3), int64(part1 + part2), nil
49+
return part3, part1 + part2, nil
5050
}
5151

5252
// CalculateToken caluculates token from tts text and seed keys.

0 commit comments

Comments
 (0)