Skip to content

Commit

Permalink
fix: cut tmp slice length in decodeRuneInByteseq
Browse files Browse the repository at this point in the history
  • Loading branch information
tdakkota committed Apr 6, 2022
1 parent f880398 commit 7018dd7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions byteseq.go
Expand Up @@ -8,6 +8,6 @@ type byteseq interface {

func decodeRuneInByteseq[T byteseq](val T) (r rune, size int) {
var tmp [4]byte
copy(tmp[:], val)
return utf8.DecodeRune(tmp[:])
n := copy(tmp[:], val)
return utf8.DecodeRune(tmp[:n])
}

0 comments on commit 7018dd7

Please sign in to comment.