summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-12-11 15:26:48 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-11 16:29:39 +0100
commitfbcad200723b36ee613df89775bf28f3503cfec0 (patch)
treef183e8b9d804d2fcdd20e20ceae8d36ad9572a08 /qt-ui
parentf09afad5a0515e2e40a91385d115840bc321697a (diff)
downloadsubsurface-fbcad200723b36ee613df89775bf28f3503cfec0.tar.gz
profilepgrahics.cpp: fix preceding limit check
ProfileGraphicsView::plot_depth_profile(): The iterator limit check (i < 7) should precede the indexing (increments[i]). Reported by the program cppcheck. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/profilegraphics.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index 18e97da78..19fe81d91 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -1098,7 +1098,7 @@ void ProfileGraphicsView::plot_depth_profile()
* we double the interval if this still doesn't get us to 12 or fewer
* time markers */
i = 0;
- while (maxtime / increments[i] > 12 && i < 7)
+ while (i < 7 && maxtime / increments[i] > 12)
i++;
incr = increments[i];
while (maxtime / incr > 12)