summaryrefslogtreecommitdiffstats
path: root/src/dfxml.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-10-12 20:40:32 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2016-10-12 20:40:32 +0200
commitf8ec7514eaf053d5d47c3db2824abc2b97c8f3d6 (patch)
tree504e70fd0e1dfb8ad3f03102f8ce232791d8b427 /src/dfxml.c
parent3ced4e8ea91a71fad7f97f41f8c1d96a04a5ff50 (diff)
PhotoRec: Fix report.xml by encoding & in filenames
Diffstat (limited to 'src/dfxml.c')
-rw-r--r--src/dfxml.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/dfxml.c b/src/dfxml.c
index c06f9f7..1a99f04 100644
--- a/src/dfxml.c
+++ b/src/dfxml.c
@@ -171,7 +171,18 @@ void xml_printf(const char *fmt,...)
void xml_out2s(const char *tag, const char *value)
{
- xml_printf("<%s>%s</%s>\n", tag, value, tag);
+ if(xml_handle==NULL)
+ return;
+ xml_spaces();
+ fprintf(xml_handle, "<%s>", tag);
+ for(;*value!='\0'; value++)
+ {
+ if(*value=='&')
+ fputs("&amp;", xml_handle);
+ else
+ putc(*value, xml_handle);
+ }
+ fprintf(xml_handle, "</%s>\n", tag);
}
void xml_out2i(const char *tag, const uint64_t value)