From b4b8a9db4e77aa015d5a90e505c1febf00ab3621 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 26 Dec 2017 15:42:32 -0800 Subject: Cleanup: avoid out of bounds access sizeof() is clearly the wrong way to get to the size of that array... Coverity CID 208297 Signed-off-by: Dirk Hohndel --- mobile-widgets/qmlmanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 20844526d..d703c2192 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -987,7 +987,7 @@ void QMLManager::commitChanges(QString diveId, QString date, QString location, Q diveChanged = true; unsigned long i; int size = 0, wp = 0; - for (i = 0; i < sizeof(tank_info) && tank_info[i].name != NULL; i++) { + for (i = 0; i < MAX_TANK_INFO && tank_info[i].name != NULL; i++) { if (tank_info[i].name == cylinder ) { if (tank_info[i].ml > 0){ size = tank_info[i].ml; -- cgit v1.2.3-70-g09d2