summaryrefslogtreecommitdiffstats
path: root/qt-ui
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-09 00:15:46 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-10-09 00:15:46 -0700
commitc74b286e70cbd2d46eac676c192f53f7491f8d85 (patch)
treee1af46b5e2dca078bfc6381b1a39917c3248b09d /qt-ui
parent7f4e4b16ed897b784df1066621d3368676907efb (diff)
downloadsubsurface-c74b286e70cbd2d46eac676c192f53f7491f8d85.tar.gz
Fix potential uninitialized variable
Most of the "possibly unitialized" warnings are bogus, but this one is a potential real bug. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r--qt-ui/profilegraphics.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/profilegraphics.cpp b/qt-ui/profilegraphics.cpp
index 9973af101..30adef132 100644
--- a/qt-ui/profilegraphics.cpp
+++ b/qt-ui/profilegraphics.cpp
@@ -217,7 +217,7 @@ QColor ProfileGraphicsView::getColor(const color_indice_t i)
void ProfileGraphicsView::plot(struct dive *d, bool forceRedraw)
{
- struct divecomputer *dc;
+ struct divecomputer *dc = NULL;
if (d)
dc = select_dc(&d->dc);
@@ -247,7 +247,7 @@ void ProfileGraphicsView::plot(struct dive *d, bool forceRedraw)
// Fix this for printing / screen later.
// plot_set_scale(scale_mode_t);
- if (!dc->samples) {
+ if (!dc || !dc->samples) {
dc = fake_dc(dc);
}