summaryrefslogtreecommitdiffstats
path: root/save-xml.c
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-05-07 08:47:41 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-05-07 09:21:51 -0700
commitba31a578570018223d68235d9614040c1ca1b925 (patch)
tree6f2ddb5ee110dd591d0fdafec0433b2d582af136 /save-xml.c
parent0325a42c0853ae219bd6686604e174f083707dcd (diff)
downloadsubsurface-ba31a578570018223d68235d9614040c1ca1b925.tar.gz
Remove trailing spaces from the produced output
The code found the trailing spaces and just didn't care about it. This also removes the FIXME quoting, because quoting is managed. 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.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/save-xml.c b/save-xml.c
index dc13fa280..a7a083ed6 100644
--- a/save-xml.c
+++ b/save-xml.c
@@ -71,6 +71,7 @@ static void quote(struct membuffer *b, const char *text, int is_attribute)
static void show_utf8(struct membuffer *b, const char *text, const char *pre, const char *post, int is_attribute)
{
int len;
+ char *cleaned;
if (!text)
return;
@@ -81,10 +82,11 @@ static void show_utf8(struct membuffer *b, const char *text, const char *pre, co
return;
while (len && isspace(text[len - 1]))
len--;
- /* FIXME! Quoting! */
+ cleaned = strndup(text, len);
put_string(b, pre);
- quote(b, text, is_attribute);
+ quote(b, cleaned, is_attribute);
put_string(b, post);
+ free(cleaned);
}
static void save_depths(struct membuffer *b, struct divecomputer *dc)