Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 402b0570 authored by Jean Chalard's avatar Jean Chalard
Browse files

Fix two small possible bugs.

None of these had any real impact, but they were potential
liabilities for the future

Change-Id: I2de581f8b638e423d47a6d99b1a3c96af4c6150d
parent e0952029
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -149,8 +149,8 @@ int BigramDictionary::getBigramListPositionForWord(const int32_t *prevWord,
    } else {
        pos = BinaryFormat::skipOtherCharacters(root, pos);
    }
    pos = BinaryFormat::skipChildrenPosition(flags, pos);
    pos = BinaryFormat::skipFrequency(flags, pos);
    pos = BinaryFormat::skipChildrenPosition(flags, pos);
    pos = BinaryFormat::skipShortcuts(root, flags, pos);
    return pos;
}
+1 −1
Original line number Diff line number Diff line
@@ -421,7 +421,7 @@ inline int BinaryFormat::getWordAtAddress(const uint8_t* const root, const int a
                    // We count chars in order to avoid infinite loops if the file is broken or
                    // if there is some other bug
                    int charCount = maxDepth;
                    while (-1 != nextChar && --charCount > 0) {
                    while (NOT_A_CHARACTER != nextChar && --charCount > 0) {
                        outWord[++wordPos] = nextChar;
                        nextChar = getCharCodeAndForwardPointer(root, &pos);
                    }