diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/xmlparser.cpp | 3 | ||||
-rw-r--r-- | common/xmlparser.h | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/common/xmlparser.cpp b/common/xmlparser.cpp index b2178afbd0..6cb3a8a441 100644 --- a/common/xmlparser.cpp +++ b/common/xmlparser.cpp @@ -148,6 +148,9 @@ bool XMLParser::parseKeyValue(Common::String keyName) { bool XMLParser::parse() { + if (_text.ready() == false) + return parserError("XML stream not ready for reading."); + bool activeClosure = false; bool selfClosure = false; diff --git a/common/xmlparser.h b/common/xmlparser.h index bfbc03b97b..3eb87efd31 100644 --- a/common/xmlparser.h +++ b/common/xmlparser.h @@ -70,6 +70,10 @@ public: delete _stream; _stream = s; } + + bool ready() { + return _stream != 0; + } }; /** @@ -116,7 +120,7 @@ public: int depth; }; - virtual bool loadFile(const char *filename) { + virtual bool loadFile(Common::String filename) { Common::File *f = new Common::File; if (!f->open(filename, Common::File::kFileReadMode)) |