aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Salvador Cuñat <salvador.cunat@gmail.com>2017-04-12 21:46:57 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-04-21 06:52:13 -0700
commit329a6bc0753260f3d0184448155a8ef6844d9b43 (patch)
treecd35ec7bcf79136a1e6983ab9e5b52401617e228
parent76975ed425e4772a55f3e2f19c8ab5a71c3ab742 (diff)
downloadsubsurface-329a6bc0753260f3d0184448155a8ef6844d9b43.tar.gz
smtk-import: Abort bookmark parsing if table doesn't open
Do not just report the failure but abort parsing or we will get a crash Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
-rw-r--r--smtk-import/smartrak.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/smtk-import/smartrak.c b/smtk-import/smartrak.c
index 6b8a1f60c..ba38c6b33 100644
--- a/smtk-import/smartrak.c
+++ b/smtk-import/smartrak.c
@@ -678,8 +678,10 @@ static void smtk_parse_bookmarks(MdbHandle *mdb, struct dive *d, char *dive_idx)
struct event *ev;
table = smtk_open_table(mdb, "Marker", col, bound_values);
- if (!table)
+ if (!table) {
report_error("[smtk-import] Error - Couldn't open table 'Marker', dive %d", d->number);
+ return;
+ }
while (mdb_fetch_row(table)) {
if (same_string(col[0]->bind_ptr, dive_idx)) {
time = lrint(strtod(col[4]->bind_ptr, NULL) * 60);