summaryrefslogtreecommitdiffstats
path: root/save-xml.c
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-05-07 00:27:51 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-06 15:35:39 -0700
commit868827f5ec4037f9a61fe70c36d0cd10dabf6459 (patch)
treec56c38af75dd6afcb0aab0b639e7939d7e7b49d7 /save-xml.c
parent7c3b68e3aeca1e6e51596f475d6fd5f286079794 (diff)
downloadsubsurface-868827f5ec4037f9a61fe70c36d0cd10dabf6459.tar.gz
Qt turns edited locations into null-strings
They aren't null pointers after you touched them, so we can't rely on that to choose if we should use put_string or show_utf8. show_utf8 would not print the tag if it only contains a \0 as body. Fixes #440 Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'save-xml.c')
-rw-r--r--save-xml.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/save-xml.c b/save-xml.c
index 227b95296..dc13fa280 100644
--- a/save-xml.c
+++ b/save-xml.c
@@ -190,7 +190,7 @@ static void show_location(struct membuffer *b, struct dive *dive)
int len = sprintf(buffer, " <location ");
len += format_location(buffer + len, latitude, longitude);
- if (!dive->location) {
+ if (!dive->location || dive->location[0] == '\0') {
memcpy(buffer + len, "/>\n\0", 5);
put_string(b, buffer);
return;