From fbcad200723b36ee613df89775bf28f3503cfec0 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Wed, 11 Dec 2013 15:26:48 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- qt-ui/profilegraphics.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) -- cgit v1.2.3-70-g09d2