diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-05-15 22:24:26 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-05-15 22:32:08 -0700 |
commit | 63c0c7921baf81833632a06b74ca1b964215b826 (patch) | |
tree | 437ffb23bffd5605287b823c47f6cc0602f16b2b | |
parent | 3a37554f357450b97e65b13e7e15438eac2dbde5 (diff) | |
download | subsurface-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>
-rw-r--r-- | equipment.c | 2 |
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; } |