mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-30 22:20:21 +00:00
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 <dirk@hohndel.org>
This commit is contained in:
parent
50571dfab3
commit
b4b8a9db4e
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue