From e5726a11424ebd48f12d76149ec7e5e2b6278bdd Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 9 May 2014 15:43:27 +0300 Subject: Fix code style. --- src/utils/xml.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/utils/xml.cpp') diff --git a/src/utils/xml.cpp b/src/utils/xml.cpp index eae3567ef..099457af3 100644 --- a/src/utils/xml.cpp +++ b/src/utils/xml.cpp @@ -79,7 +79,8 @@ static void xmlErrorLogger(void *ctx A_UNUSED, const char *msg, ...) namespace XML { Document::Document(const std::string &filename, const bool useResman) : - mDoc(nullptr) + mDoc(nullptr), + mIsValid(false) { #ifdef USE_FUZZER if (Fuzzer::conditionTerminate(filename.c_str())) @@ -134,7 +135,8 @@ namespace XML } Document::Document(const char *const data, const int size) : - mDoc(data ? xmlParseMemory(data, size) : nullptr) + mDoc(data ? xmlParseMemory(data, size) : nullptr), + mIsValid(true) { } @@ -241,7 +243,7 @@ namespace XML return def; } - XmlNodePtr findFirstChildByName(const XmlNodePtr parent, + XmlNodePtr findFirstChildByName(const XmlNodePtrConst parent, const char *const name) { for_each_xml_child_node(child, parent) @@ -272,11 +274,11 @@ namespace XML bool Document::validateXml(const std::string &fileName) { - xmlDocPtr doc = xmlReadFile(fileName.c_str(), + const xmlDocPtr doc = xmlReadFile(fileName.c_str(), nullptr, XML_PARSE_PEDANTIC); - const bool valid(doc); + const bool valid1(doc); xmlFreeDoc(doc); - if (!valid) + if (!valid1) return false; std::ifstream file; -- cgit v1.2.3-70-g09d2