[PATCH 6/6] planner.c: prevent an uninitialized warning

Lubomir I. Ivanov neolit123 at gmail.com
Mon Jun 9 14:18:00 PDT 2014

From: "Lubomir I. Ivanov" <neolit123 at gmail.com>

"warning: 'bottom_time' may be used uninitialized in this

we set it to zero for now.

Signed-off-by: Lubomir I. Ivanov <neolit123 at gmail.com>
this patch went outside of the [5/5] series
 planner.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/planner.c b/planner.c
index 8cc9b6f..c34b59a 100644
--- a/planner.c
+++ b/planner.c
@@ -692,7 +692,7 @@ void plan(struct diveplan *diveplan, char **cached_datap, struct dive **divep, s
 	bool stopping = false;
 	bool clear_to_ascend;
 	int clock, previous_point_time;
-	int avg_depth, bottom_time;
+	int avg_depth, bottom_time = 0;
 	int last_ascend_rate;
 	int best_first_ascend_cylinder;
 	struct gasmix gas;

More information about the subsurface mailing list