]> Cypherpunks repositories - gostls13.git/commitdiff
bufio: make string(int) conversion safer
authorsmasher164 <aindurti@gmail.com>
Thu, 26 Nov 2020 19:16:33 +0000 (14:16 -0500)
committerRobert Griesemer <gri@golang.org>
Sat, 28 Nov 2020 03:50:50 +0000 (03:50 +0000)
Updates #42792.

Change-Id: I7e53426c41e5609d9dadceb300f7983ba7ad6577
Reviewed-on: https://go-review.googlesource.com/c/go/+/273526
Run-TryBot: Akhil Indurti <aindurti@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/bufio/bufio_test.go

index 75086f1f24076693c72808de02ff7624acd8c951..d7b34bd0d8f66b485a49ad355fce86c3a9d5f726 100644 (file)
@@ -146,7 +146,7 @@ func TestReader(t *testing.T) {
        for i := 0; i < len(texts)-1; i++ {
                texts[i] = str + "\n"
                all += texts[i]
-               str += string(rune(i)%26 + 'a')
+               str += string(rune(i%26 + 'a'))
        }
        texts[len(texts)-1] = all