Skip to content

Commit 54837b1

Browse files
authored
Merge pull request #84 from google/drinckes-patch-3
go: code length validation in encode
2 parents 7278c63 + 659e768 commit 54837b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

go/encode.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ func Encode(lat, lng float64, codeLen int) string {
5757
codeLen = pairCodeLen
5858
} else if codeLen < 2 {
5959
codeLen = 2
60-
} else if codeLen < sepPos && codeLen%2 == 1 {
60+
} else if codeLen < pairCodeLen && codeLen%2 == 1 {
6161
codeLen++
6262
}
6363
lat, lng = clipLatitude(lat), normalizeLng(lng)

0 commit comments

Comments
 (0)