summaryrefslogtreecommitdiffstats
path: root/libdivecomputer.c
diff options
context:
space:
mode:
Diffstat (limited to 'libdivecomputer.c')
-rw-r--r--libdivecomputer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c
index 309605e56..c0c8e0bbb 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -124,7 +124,9 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
dive->cylinder[i].gasmix.o2.permille = o2;
dive->cylinder[i].gasmix.he.permille = he;
- if (!get_tanksize(devdata, data, dive->cylinder, i))
+ /* for the first tank, if there is no tanksize available from the
+ * dive computer, fill in the default tank information (if set) */
+ if (i == 0 && !get_tanksize(devdata, data, dive->cylinder, i))
fill_default_cylinder(&dive->cylinder[i]);
}
return DC_STATUS_SUCCESS;