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>
This commit is contained in:
Lubomir I. Ivanov 2013-12-11 15:26:48 +02:00 committed by Dirk Hohndel
parent f09afad5a0
commit fbcad20072

View file

@ -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)