]> git.lyx.org Git - features.git/commitdiff
Make a false positive explicit
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 8 Mar 2017 15:50:03 +0000 (16:50 +0100)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Wed, 8 Mar 2017 15:50:03 +0000 (16:50 +0100)
Pleases coverity

src/mathed/MathData.cpp

index 9d218987d3245e2a36513b7ddf84f2113dffc8b6..8ff94614520a13dbbb9da1bb417cb8d4bb843f40 100644 (file)
@@ -825,7 +825,10 @@ void MathData::collectParameters(Cursor * cur,
                }
 
                // put cursor in argument again
-               if (thisSlice != - 1 && thisPos == int(pos)) {
+               // Note: The first two expressions on the first line are
+               // equivalent (see caller), but making this explicit pleases
+               // coverity.
+               if (cur && thisSlice != -1 && thisPos == int(pos)) {
                        cur->append(params.size() - 1, argPos);
                        cur->append(argSlices);
                        (*cur)[thisSlice].pos() = macroPos;