aboutsummaryrefslogtreecommitdiffstats
path: root/qt-models
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-07-09 12:37:05 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-07-09 12:37:05 -0700
commit5de89e036dcb17d92c97abf7cf76973ac11b5ecd (patch)
tree17291939fb946c9b22071404f5667d588d1b4059 /qt-models
parent9762b72b7dc2988b72971496b13bf74a1b2a9413 (diff)
downloadsubsurface-5de89e036dcb17d92c97abf7cf76973ac11b5ecd.tar.gz
Prevent using an uninitialized value
This could otherwise lead to crashes if you start a plan with a dive selected that has no cylinders. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-models')
-rw-r--r--qt-models/diveplannermodel.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp
index 16dca5224..69706c88f 100644
--- a/qt-models/diveplannermodel.cpp
+++ b/qt-models/diveplannermodel.cpp
@@ -598,7 +598,7 @@ int DivePlannerPointsModel::lastEnteredPoint()
int DivePlannerPointsModel::addStop(int milimeters, int seconds, int cylinderid_in, int ccpoint, bool entered)
{
- int cylinderid;
+ int cylinderid = 0;
bool usePrevious = false;
if (cylinderid_in)
cylinderid = cylinderid_in;