From 956d1897345c727af23089cd98cef34597aed9ff Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 6 Dec 2015 09:40:21 -0800 Subject: Only warn about different number of tanks and gases if there are tanks Some backends support giving tank data for some, but not all models that they support (and simply report no tanks for those models that don't support this). The Suunto Vyper is one of the dive computers where this happens and without this change we report angry red warnings after a perfectly correct download. So this changes the logic to only show that error if there actually were tanks reported. Signed-off-by: Dirk Hohndel --- subsurface-core/libdivecomputer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'subsurface-core') diff --git a/subsurface-core/libdivecomputer.c b/subsurface-core/libdivecomputer.c index 8ed29edd7..39908847b 100644 --- a/subsurface-core/libdivecomputer.c +++ b/subsurface-core/libdivecomputer.c @@ -77,7 +77,7 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t int ntanks = 0; rc = dc_parser_get_field(parser, DC_FIELD_TANK_COUNT, 0, &ntanks); if (rc == DC_STATUS_SUCCESS) { - if (ntanks != ngases) { + if (ntanks && ntanks != ngases) { shown_warning = true; report_error("different number of gases (%d) and tanks (%d)", ngases, ntanks); } -- cgit v1.2.3-70-g09d2