From: Matthew Dempsky Date: Thu, 25 Feb 2016 00:20:59 +0000 (-0800) Subject: cmd/compile: fix off-by-1 in getr X-Git-Tag: go1.7beta1~1730 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=772cea817d075c496091f4c735800f14159c5051;p=gostls13.git cmd/compile: fix off-by-1 in getr Introduced by (and missed during code review of) golang.org/cl/19847. Change-Id: I03b76f36e5da69c31730380592dfa1c32570e17f Reviewed-on: https://go-review.googlesource.com/19912 Run-TryBot: Matthew Dempsky Reviewed-by: Robert Griesemer TryBot-Result: Gobot Gobot --- diff --git a/src/cmd/compile/internal/gc/lex.go b/src/cmd/compile/internal/gc/lex.go index 562b2b9001..71ed8d6841 100644 --- a/src/cmd/compile/internal/gc/lex.go +++ b/src/cmd/compile/internal/gc/lex.go @@ -1873,7 +1873,7 @@ redo: // The string conversion here makes a copy for passing // to fmt.Printf, so that buf itself does not escape and // can be allocated on the stack. - Yyerror("illegal UTF-8 sequence % x", string(buf[:i+1])) + Yyerror("illegal UTF-8 sequence % x", string(buf[:i])) } if r == BOM {