summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2015-08-02 18:36:38 +0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-08-03 22:21:19 -0700
commitabbebef997edde90fe947666084957a206fb6a42 (patch)
tree8e090425580ef1ace38847ee83552c316d8c6abf /parse-xml.c
parent30bdc83105aa51e8267483349fe2ce0436544b13 (diff)
downloadsubsurface-abbebef997edde90fe947666084957a206fb6a42.tar.gz
Divinglog import: ignore unsupported cylinders
Subsurface supports currently 8 cylinders, thus we should not attempt to add more. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/parse-xml.c b/parse-xml.c
index e63ed4fa2..7c8d6bd7f 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -2851,6 +2851,14 @@ extern int divinglog_cylinder(void *handle, int columns, char **data, char **col
short dbl = 1;
//char get_cylinder_template[] = "select TankID,TankSize,PresS,PresE,PresW,O2,He,DblTank from Tank where LogID = %d";
+ /*
+ * Divinglog might have more cylinders than what we support. So
+ * better to ignore those.
+ */
+
+ if (cur_cylinder_index >= MAX_CYLINDERS)
+ return 0;
+
if (data[7] && atoi(data[7]) > 0)
dbl = 2;