summaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorGravatar Boris Barbulovski <bbarbulovski@gmail.com>2014-02-10 15:50:45 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-02-10 07:54:17 -0800
commit3e41047d41388002039f8863b35de3b9bfc30888 (patch)
treeec07116efc1f13bd739fce7380e89849665ff97e /profile.c
parent0e3852e62567e9ae2073889821baf5b651bdf228 (diff)
downloadsubsurface-3e41047d41388002039f8863b35de3b9bfc30888.tar.gz
Fix plot_info calculate_max_limits_new() function return value
The return value(structure) was not fully initialized, thus random data returned for uninitialized members possibly causing random bahavior. Signed-off-by: Boris Barbulovski <bbarbulovski@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/profile.c b/profile.c
index 855d16c86..14b76f70e 100644
--- a/profile.c
+++ b/profile.c
@@ -770,6 +770,7 @@ struct plot_info calculate_max_limits_new(struct dive *dive, struct divecomputer
if (minpressure > maxpressure)
minpressure = 0;
+ memset(&pi, 0, sizeof(pi));
pi.maxdepth = maxdepth;
pi.maxtime = maxtime;
pi.maxpressure = maxpressure;