mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-17 21:06:17 +00:00
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>
This commit is contained in:
parent
76975ed425
commit
329a6bc075
1 changed files with 3 additions and 1 deletions
|
@ -678,8 +678,10 @@ static void smtk_parse_bookmarks(MdbHandle *mdb, struct dive *d, char *dive_idx)
|
||||||
struct event *ev;
|
struct event *ev;
|
||||||
|
|
||||||
table = smtk_open_table(mdb, "Marker", col, bound_values);
|
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);
|
report_error("[smtk-import] Error - Couldn't open table 'Marker', dive %d", d->number);
|
||||||
|
return;
|
||||||
|
}
|
||||||
while (mdb_fetch_row(table)) {
|
while (mdb_fetch_row(table)) {
|
||||||
if (same_string(col[0]->bind_ptr, dive_idx)) {
|
if (same_string(col[0]->bind_ptr, dive_idx)) {
|
||||||
time = lrint(strtod(col[4]->bind_ptr, NULL) * 60);
|
time = lrint(strtod(col[4]->bind_ptr, NULL) * 60);
|
||||||
|
|
Loading…
Add table
Reference in a new issue