From 99927c70718350dfd4e70e7b408ba1bcbc80d81d Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 1 Aug 2017 22:04:42 +0900 Subject: [PATCH] Modify loop conditions in checkAscii function --- src/util/chars.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/chars.go b/src/util/chars.go index 0127bcb..b06a682 100644 --- a/src/util/chars.go +++ b/src/util/chars.go @@ -24,12 +24,12 @@ type Chars struct { func checkAscii(bytes []byte) (bool, int) { i := 0 - for ; i < len(bytes)-8; i += 8 { + for ; i <= len(bytes)-8; i += 8 { if (overflow64 & *(*uint64)(unsafe.Pointer(&bytes[i]))) > 0 { return false, i } } - for ; i < len(bytes)-4; i += 4 { + for ; i <= len(bytes)-4; i += 4 { if (overflow32 & *(*uint32)(unsafe.Pointer(&bytes[i]))) > 0 { return false, i }