Fix segmentation fault on exporting picture depths

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Miika Turkia 2015-01-25 16:47:50 +02:00 committed by Dirk Hohndel
parent d47191a3a6
commit f70a83667b

View file

@ -320,7 +320,7 @@ void DiveLogExportDialog::export_depths(const char *filename, const bool selecte
struct dive *dive;
depth_t depth;
int i;
const char **unit = NULL;
const char *unit = NULL;
struct membuffer buf = { 0 };
@ -336,7 +336,7 @@ 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%s\n", picture->filename, get_depth_units(depth.mm, NULL, &unit), unit);
}
}