diff --git a/encfs/XmlReader.cpp b/encfs/XmlReader.cpp index c0aaf9b..285a7ef 100644 --- a/encfs/XmlReader.cpp +++ b/encfs/XmlReader.cpp @@ -23,6 +23,8 @@ #include // for remove_if #include // for NULL #include // for shared_ptr +#include // for ifstream +#include // for ostringstream #include // for XMLElement, XMLNode, XMLDocument (ptr only) @@ -167,7 +169,12 @@ XmlReader::~XmlReader() {} bool XmlReader::load(const char *fileName) { pd->doc.reset(new tinyxml2::XMLDocument()); - auto err = pd->doc->LoadFile(fileName); + std::ifstream in(fileName); + if (!in) return false; + + std::ostringstream fileContent; + fileContent << in.rdbuf(); + auto err = pd->doc->Parse(fileContent.str().c_str()); return err == tinyxml2::XML_SUCCESS; }