From 868827f5ec4037f9a61fe70c36d0cd10dabf6459 Mon Sep 17 00:00:00 2001 From: Anton Lundin Date: Wed, 7 May 2014 00:27:51 +0200 Subject: [PATCH] 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 Signed-off-by: Dirk Hohndel --- save-xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { + if (!dive->location || dive->location[0] == '\0') { memcpy(buffer + len, "/>\n\0", 5); put_string(b, buffer); return;