aboutsummaryrefslogtreecommitdiffstats
path: root/core/save-xml.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2021-09-02 09:05:31 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-09-03 09:30:34 -0700
commit5eda1c0e39b7c5e4e68ec68596cb023e37503ba7 (patch)
treef5e445464c5a01f4423dcb45ca9f6182c29278fc /core/save-xml.c
parent836111da982a6580e314d8297c47ad96be5065a2 (diff)
downloadsubsurface-5eda1c0e39b7c5e4e68ec68596cb023e37503ba7.tar.gz
parser: XML_PARSE_RECOVER to xmlReadMemory()
Due to changes in the handling of sensor-ids, invalid XMLs were generated. In particular, these contained duplicate attributes in the sample tags. Even though these files shouldn't exist, let's try to parse them anyway. Some data will be lost, but that's better than not opening the file. libxml2 can be told to try to recover from such petty(?) errors by passing the XML_PARSE_RECOVER flag. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'core/save-xml.c')
-rw-r--r--core/save-xml.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/save-xml.c b/core/save-xml.c
index 3836ea35c..a82fcef4b 100644
--- a/core/save-xml.c
+++ b/core/save-xml.c
@@ -865,7 +865,7 @@ static int export_dives_xslt_doit(const char *filename, struct xml_params *param
* transform it to selected export format, finally dumping
* the XML into a character buffer.
*/
- doc = xmlReadMemory(buf.buffer, buf.len, "divelog", NULL, XML_PARSE_HUGE);
+ doc = xmlReadMemory(buf.buffer, buf.len, "divelog", NULL, XML_PARSE_HUGE | XML_PARSE_RECOVER);
free_buffer(&buf);
if (!doc)
return report_error("Failed to read XML memory");