diff options
author | 2012-09-06 08:23:43 -0700 | |
---|---|---|
committer | 2012-09-06 08:23:43 -0700 | |
commit | 3f31e96362a38e090a822b36b1de788a1ee04ed2 (patch) | |
tree | 17cce6b77a81e7eb1a1a475607092c7ed384c380 /native/jni/src/binary_format.h | |
parent | 23f8c24d795dec9634c6d2df4c2e7b4d8323d65d (diff) | |
parent | 3518ed6031a1bcb9a501be4b9e1f5b82568185bd (diff) | |
download | latinime-3f31e96362a38e090a822b36b1de788a1ee04ed2.tar.gz latinime-3f31e96362a38e090a822b36b1de788a1ee04ed2.tar.xz latinime-3f31e96362a38e090a822b36b1de788a1ee04ed2.zip |
am 3518ed60: Merge "Fix one-off bugs reported by Valgrind" into jb-mr1-dev
* commit '3518ed6031a1bcb9a501be4b9e1f5b82568185bd':
Fix one-off bugs reported by Valgrind
Diffstat (limited to '')
-rw-r--r-- | native/jni/src/binary_format.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/native/jni/src/binary_format.h b/native/jni/src/binary_format.h index 5d8b2a0f2..eec52e323 100644 --- a/native/jni/src/binary_format.h +++ b/native/jni/src/binary_format.h @@ -360,7 +360,7 @@ inline int BinaryFormat::getTerminalPosition(const uint8_t *const root, while (true) { // If we already traversed the tree further than the word is long, there means // there was no match (or we would have found it). - if (wordPos > length) return NOT_VALID_WORD; + if (wordPos >= length) return NOT_VALID_WORD; int charGroupCount = BinaryFormat::getGroupCountAndForwardPointer(root, &pos); const int32_t wChar = forceLowerCaseSearch ? toLowerCase(inWord[wordPos]) : inWord[wordPos]; while (true) { @@ -383,7 +383,7 @@ inline int BinaryFormat::getTerminalPosition(const uint8_t *const root, // character that does not match, as explained above, it means the word is // not in the dictionary (by virtue of this chargroup being the only one to // match the word on the first character, but not matching the whole word). - if (wordPos > length) return NOT_VALID_WORD; + if (wordPos >= length) return NOT_VALID_WORD; if (inWord[wordPos] != character) return NOT_VALID_WORD; character = BinaryFormat::getCodePointAndForwardPointer(root, &pos); } |