From 70737b9eec9e0ff799a5a95e1b714ed1822010cd Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 26 Oct 2019 07:54:57 -0400 Subject: Cleanup: use correct loop bounds I'm a bit confused why this enum has two extra values, NUM_DIVEMODE and UNDEF_COMP_TYPE. I can see how this could create confusion. This may benefit from addition review. Found by Coverity. Fixes CID 350092. Signed-off-by: Dirk Hohndel --- profile-widget/profilewidget2.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'profile-widget') diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp index 9389eaaeb..186638a41 100644 --- a/profile-widget/profilewidget2.cpp +++ b/profile-widget/profilewidget2.cpp @@ -1652,7 +1652,7 @@ void ProfileWidget2::addDivemodeSwitch() int i; QAction *action = qobject_cast(sender()); QPointF scenePos = mapToScene(mapFromGlobal(action->data().toPoint())); - for (i = 0; i < UNDEF_COMP_TYPE; i++) + for (i = 0; i < NUM_DIVEMODE; i++) if (gettextFromC::tr(divemode_text_ui[i]) == action->text()) add_event(current_dc, lrint(timeAxis->valueAt(scenePos)), 8, 0, i, QT_TRANSLATE_NOOP("gettextFromC", "modechange")); -- cgit v1.2.3-70-g09d2