From 04bca45552b59441e41dbf4e66cb8b7ce9baa021 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 26 Dec 2017 16:05:26 -0800 Subject: Cleanup: avoid out of bounds access sizeof() is clearly the wrong way to get to the size of that array... Coverity CID 208290 Signed-off-by: Dirk Hohndel --- core/subsurface-qt/DiveObjectHelper.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/subsurface-qt/DiveObjectHelper.cpp b/core/subsurface-qt/DiveObjectHelper.cpp index 8ea8b6370..bc7bd397c 100644 --- a/core/subsurface-qt/DiveObjectHelper.cpp +++ b/core/subsurface-qt/DiveObjectHelper.cpp @@ -280,7 +280,7 @@ QStringList DiveObjectHelper::cylinderList() const } } - for (unsigned long ti = 0; ti < sizeof(tank_info) && tank_info[ti].name != NULL; ti++) { + for (unsigned long ti = 0; ti < MAX_TANK_INFO && tank_info[ti].name != NULL; ti++) { QString cyl = tank_info[ti].name; if (cyl == EMPTY_DIVE_STRING) continue; -- cgit v1.2.3-70-g09d2