Patch to fix bug in zero length files. From the AriaMaestosa project.
This commit is contained in:
parent
765d142663
commit
8c4e251472
1 changed files with 17 additions and 0 deletions
17
irrxml/patches/patch-src_irrXML.cpp
Normal file
17
irrxml/patches/patch-src_irrXML.cpp
Normal file
|
@ -0,0 +1,17 @@
|
|||
$NetBSD: patch-src_irrXML.cpp,v 1.1 2012/11/02 23:51:45 othyro Exp $
|
||||
|
||||
Fixes bug if filesize is 0.
|
||||
|
||||
--- src/irrXML.cpp.orig 2005-08-20 21:17:54.000000000 +0000
|
||||
+++ src/irrXML.cpp
|
||||
@@ -83,7 +83,9 @@ private:
|
||||
//! Creates an instance of an UFT-8 or ASCII character xml parser.
|
||||
IrrXMLReader* createIrrXMLReader(const char* filename)
|
||||
{
|
||||
- return new CXMLReaderImpl<char, IXMLBase>(new CFileReadCallBack(filename));
|
||||
+ CFileReadCallBack* file = new CFileReadCallBack(filename);
|
||||
+ if (file->getSize() == 0) return NULL;
|
||||
+ return new CXMLReaderImpl<char, IXMLBase>(file);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in a new issue