From e18494f0125c2625d3acd186321c7a54dc05f0fd Mon Sep 17 00:00:00 2001
From: "Lubomir I. Ivanov" <neolit123@gmail.com>
Date: Sat, 25 Oct 2014 12:05:28 +0300
Subject: [PATCH 4/9] divelogexportdialog.cpp: fix a 'uninitialized variable'
 warning

DiveLogExportDialog::export_depths()

We set a default value of 'unit' which will silence the warning itself.
Then hope that the compiler will respect the argument order i.e. call
get_depth_units() (which sets 'unit') before using *unit as the last
argument passsed to put_format().

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
---
 qt-ui/divelogexportdialog.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/qt-ui/divelogexportdialog.cpp b/qt-ui/divelogexportdialog.cpp
index a0fbc50..4e00b4e 100644
--- a/qt-ui/divelogexportdialog.cpp
+++ b/qt-ui/divelogexportdialog.cpp
@@ -322,7 +322,7 @@ void DiveLogExportDialog::export_depths(const char *filename, const bool selecte
 	struct dive *dive;
 	depth_t depth;
 	int i;
-	const char **unit;
+	const char **unit = NULL;
 
 	struct membuffer buf = { 0 };
 
-- 
1.7.11.msysgit.0

