summaryrefslogtreecommitdiffstats
path: root/equipment.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-15 22:24:26 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-05-15 22:32:08 -0700
commit63c0c7921baf81833632a06b74ca1b964215b826 (patch)
tree437ffb23bffd5605287b823c47f6cc0602f16b2b /equipment.c
parent3a37554f357450b97e65b13e7e15438eac2dbde5 (diff)
downloadsubsurface-63c0c7921baf81833632a06b74ca1b964215b826.tar.gz
Avoid reading an uninitialized variable when adding new cylinders
If mbar = 0 then *p would not be set, but the variable was then used in the calling function. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'equipment.c')
-rw-r--r--equipment.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/equipment.c b/equipment.c
index 2d90f7a52..97388e79b 100644
--- a/equipment.c
+++ b/equipment.c
@@ -102,6 +102,8 @@ static void convert_volume_pressure(int ml, int mbar, double *v, double *p)
else
pressure = mbar / 1000.0;
*p = pressure;
+ } else {
+ *p = 0;
}
*v = volume;
}