summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-09 13:40:17 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-02-10 15:03:48 -0800
commit47dd0a1ec5230c30bdb809b0c61521ac8bd22fca (patch)
tree93a20c9c4925bb0a6db0b658e8361fbfa039b3af
parentf39962469d726d6ae7e13931763b3e13c59d626a (diff)
downloadsubsurface-47dd0a1ec5230c30bdb809b0c61521ac8bd22fca.tar.gz
Prevent a tank from looking undefined by mistake
If we have no default cylidner set and get no data about an air tank from libdivecomputer, our cylinder will look completely empty by mistake. Always setting some kind of description fixes that. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--libdivecomputer.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libdivecomputer.c b/libdivecomputer.c
index 6a16eb12d..942b1ec14 100644
--- a/libdivecomputer.c
+++ b/libdivecomputer.c
@@ -107,6 +107,9 @@ static int parse_gasmixes(device_data_t *devdata, struct dive *dive, dc_parser_t
* dive computer, fill in the default tank information (if set) */
fill_default_cylinder(&dive->cylinder[i]);
}
+ /* whatever happens, make sure there is a name for the cylidner */
+ if (same_string(dive->cylinder[i].type.description, ""))
+ dive->cylinder[i].type.description = strdup(translate("gettextFromC", "unknown"));
}
return DC_STATUS_SUCCESS;
}