The unit was stored to the variable after it was used, thus we need to
delay the print of the unit slightly. (In practice the depth unit for
first picture was null before this fix.)

Signed-off-by: Miika Turkia <[email protected]>
---
 qt-ui/divelogexportdialog.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/qt-ui/divelogexportdialog.cpp b/qt-ui/divelogexportdialog.cpp
index a747932..cb7d6a0 100644
--- a/qt-ui/divelogexportdialog.cpp
+++ b/qt-ui/divelogexportdialog.cpp
@@ -336,7 +336,8 @@ void DiveLogExportDialog::export_depths(const char 
*filename, const bool selecte
                                depth.mm = s->depth.mm;
                                s++;
                        }
-                       put_format(&buf, "%s\t%.1f%s\n", picture->filename, 
get_depth_units(depth.mm, NULL, &unit), unit);
+                       put_format(&buf, "%s\t%.1f", picture->filename, 
get_depth_units(depth.mm, NULL, &unit));
+                       put_format(&buf, "%s\n", unit);
                }
        }
 
-- 
1.9.1

_______________________________________________
subsurface mailing list
[email protected]
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to