diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-12-06 09:40:21 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-12-06 09:40:21 -0800 |
commit | 956d1897345c727af23089cd98cef34597aed9ff (patch) | |
tree | 350eb8d09cc2683118cd13edfe71c3645928dc4e /subsurface-core/libdivecomputer.c | |
parent | b5fcfc8867e937ee4ecd607ea7c621b660954e53 (diff) | |
download | subsurface-956d1897345c727af23089cd98cef34597aed9ff.tar.gz |
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 <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/libdivecomputer.c')
-rw-r--r-- | subsurface-core/libdivecomputer.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); } |