aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRui Ueyama <ruiu@google.com>2014-04-21 17:00:27 -0700
committerIan Lance Taylor <iant@golang.org>2014-04-21 17:00:27 -0700
commit7ff8e90eb7ceb2016aa9fc736febd8a5902ec65e (patch)
treee5a384568d92c7959f0f328c4a93edc673407d27
parent2653386ce8dfd497fb9b8f65bc75ef9adf8e7b58 (diff)
downloadgo1.3beta1.tar.gz
go1.3beta1.zip
strings: fix off-by-one error in testgo1.3beta1
Previously it would panic because of out-of-bound access if s1 is longer than s2. LGTM=iant R=golang-codereviews, iant CC=golang-codereviews https://golang.org/cl/90110043
-rw-r--r--src/pkg/strings/strings_test.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/strings/strings_test.go b/src/pkg/strings/strings_test.go
index 8347818d59..95a42019a3 100644
--- a/src/pkg/strings/strings_test.go
+++ b/src/pkg/strings/strings_test.go
@@ -652,7 +652,7 @@ func equal(m string, s1, s2 string, t *testing.T) bool {
e1 := Split(s1, "")
e2 := Split(s2, "")
for i, c1 := range e1 {
- if i > len(e2) {
+ if i >= len(e2) {
break
}
r1, _ := utf8.DecodeRuneInString(c1)