summaryrefslogtreecommitdiffstats
path: root/save-git.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-10 09:49:32 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-07-10 09:49:32 -0700
commita0f88e4c9fe5a7881dffb15d8ec4878a81d563b1 (patch)
tree55584f6389275c5fce30202aba0d562173ddcd74 /save-git.c
parentebcf3e67c5d2ab59fb69cec2a0fc0c52c0ebd563 (diff)
downloadsubsurface-a0f88e4c9fe5a7881dffb15d8ec4878a81d563b1.tar.gz
Git storage: only show geo cat if there is a value
Otherwise we could get mangled data since the newline isn't printed. Now a good question would be "why do we have empty values in our data", but either way, we should write invalid data to the git repository. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-git.c')
-rw-r--r--save-git.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/save-git.c b/save-git.c
index a8e0582f3..c47d89980 100644
--- a/save-git.c
+++ b/save-git.c
@@ -900,7 +900,7 @@ static void save_divesites(git_repository *repo, struct dir *tree)
if (prefs.geocoding.enable_geocoding)
for (int j = 0; j < ds->taxonomy.nr; j++) {
struct taxonomy *t = &ds->taxonomy.category[j];
- if (t->category != TC_NONE) {
+ if (t->category != TC_NONE && t->value) {
put_format(&b, "geo cat %d origin %d ", t->category, t->origin);
show_utf8(&b, "", t->value, "\n" );
}