1
0
forked from 0ad/0ad

Fix crash when loading zero-length config files

This was SVN commit r8634.
This commit is contained in:
Ykkrosh 2010-11-17 01:39:14 +00:00
parent b13e6ae293
commit f286ce0b13

View File

@ -352,7 +352,7 @@ bool CConfigDB::Reload(EConfigNamespace ns)
if (!next) next=filebufend;
char *lend=next;
if (*(lend-1) == '\r') lend--;
if (lend > filebuf && *(lend-1) == '\r') lend--;
// Send line to parser
bool parseOk=parserLine.ParseString(parser, std::string(pos, lend));