From 3e41047d41388002039f8863b35de3b9bfc30888 Mon Sep 17 00:00:00 2001 From: Boris Barbulovski Date: Mon, 10 Feb 2014 15:50:45 +0100 Subject: 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 Signed-off-by: Dirk Hohndel --- profile.c | 1 + 1 file changed, 1 insertion(+) 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; -- cgit v1.2.3-70-g09d2