bufio: make string(int) conversion safer

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>
This commit is contained in:
smasher164 2020-11-26 14:16:33 -05:00 committed by Robert Griesemer
parent b94346e69b
commit 358d35455d

View 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