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>
This commit is contained in:
Boris Barbulovski 2014-02-10 15:50:45 +01:00 committed by Dirk Hohndel
parent 0e3852e625
commit 3e41047d41

View file

@ -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;