summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorJunegunn Choi <junegunn.c@gmail.com>2017-08-01 22:04:42 +0900
committerJunegunn Choi <junegunn.c@gmail.com>2017-08-01 22:04:42 +0900
commit99927c70718350dfd4e70e7b408ba1bcbc80d81d (patch)
tree4542b704634655cba3af11cd44f26d03eafdb903 /src/util
parent3e28403978a09082aaf3269da59e2c47666c75ba (diff)
Modify loop conditions in checkAscii function
Diffstat (limited to 'src/util')
-rw-r--r--src/util/chars.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util/chars.go b/src/util/chars.go
index 0127bcbf..b06a682b 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
}