summaryrefslogtreecommitdiffstats
path: root/core/import-shearwater.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/import-shearwater.c')
-rw-r--r--core/import-shearwater.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/core/import-shearwater.c b/core/import-shearwater.c
index cd5815c6e..1c1e68eb4 100644
--- a/core/import-shearwater.c
+++ b/core/import-shearwater.c
@@ -28,8 +28,7 @@ static int shearwater_cylinders(void *param, int columns, char **data, char **co
if (o2 == 990 && he == 0)
o2 = 1000;
- cylinder_start(state);
- cyl = &state->cur_dive->cylinders.cylinders[state->cur_dive->cylinders.nr - 1];
+ cyl = cylinder_start(state);
cyl->gasmix.o2.permille = o2;
cyl->gasmix.he.permille = he;
cylinder_end(state);
@@ -70,8 +69,7 @@ static int shearwater_changes(void *param, int columns, char **data, char **colu
}
if (!found) {
// Cylinder not found, creating a new one
- cylinder_start(state);
- cyl = &state->cur_dive->cylinders.cylinders[state->cur_dive->cylinders.nr - 1];
+ cyl = cylinder_start(state);
cyl->gasmix.o2.permille = o2;
cyl->gasmix.he.permille = he;
cylinder_end(state);