From f9ec2ea40e64300b0efd106cfa9b271a113f6a38 Mon Sep 17 00:00:00 2001 From: evalphobia Date: Mon, 19 Feb 2018 19:49:28 +0900 Subject: [PATCH] Fix overflow bug --- googletts/token.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/googletts/token.go b/googletts/token.go index 91250bd..2c850af 100644 --- a/googletts/token.go +++ b/googletts/token.go @@ -42,11 +42,11 @@ func getTTSKeyFromHTML() (key1, key2 int64, err error) { if len(matchList) != 4 { return 0, 0, fmt.Errorf("HTML parse error") } - part1, _ := strconv.Atoi(matchList[1]) - part2, _ := strconv.Atoi(matchList[2]) - part3, _ := strconv.Atoi(matchList[3]) + part1, _ := strconv.ParseInt(matchList[1], 10, 64) + part2, _ := strconv.ParseInt(matchList[2], 10, 64) + part3, _ := strconv.ParseInt(matchList[3], 10, 64) - return int64(part3), int64(part1 + part2), nil + return part3, part1 + part2, nil } // CalculateToken caluculates token from tts text and seed keys.