]> git.lyx.org Git - lyx.git/commitdiff
Do not read array before checking the bounds
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 20 Feb 2015 15:51:20 +0000 (16:51 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 20 Feb 2015 15:51:20 +0000 (16:51 +0100)
Fixes coverity issue 23377

src/frontends/qt4/GuiSymbols.cpp

index 1e7e7891bf2f73ac49ece06350475d533669cb5f..6ccecf52411a4777fe8b2fc30938ac44a03656fb 100644 (file)
@@ -176,7 +176,7 @@ QString getBlock(char_type c)
 
        // guessing was wrong so far. do a real search.
        int i = 0;
-       while (c > unicode_blocks[i].end && i < no_blocks)
+       while (i < no_blocks && c > unicode_blocks[i].end)
                ++i;
        if (i == no_blocks)
                return QString();