minor tweak to script recursion depth checks
This commit is contained in:
parent
a8d26b6ce3
commit
386fa9b807
@ -92,7 +92,7 @@ TReadScriptFile::~TReadScriptFile(void){
|
|||||||
|
|
||||||
void TReadScriptFile::open(const char *FileName){
|
void TReadScriptFile::open(const char *FileName){
|
||||||
int Depth = this->RecursionDepth + 1;
|
int Depth = this->RecursionDepth + 1;
|
||||||
if((Depth + 1) >= NARRAY(this->File)){
|
if(Depth >= NARRAY(this->File)){
|
||||||
::error("TReadScriptFile::open: Rekursionstiefe zu groß.\n");
|
::error("TReadScriptFile::open: Rekursionstiefe zu groß.\n");
|
||||||
throw "Recursion depth too high";
|
throw "Recursion depth too high";
|
||||||
}
|
}
|
||||||
@ -139,7 +139,7 @@ void TReadScriptFile::close(void){
|
|||||||
|
|
||||||
void TReadScriptFile::error(const char *Text){
|
void TReadScriptFile::error(const char *Text){
|
||||||
int Depth = this->RecursionDepth;
|
int Depth = this->RecursionDepth;
|
||||||
ASSERT(Depth >= 0 && Depth <= NARRAY(this->File));
|
ASSERT(Depth >= 0 && Depth < NARRAY(this->File));
|
||||||
|
|
||||||
const char *Filename = this->Filename[Depth];
|
const char *Filename = this->Filename[Depth];
|
||||||
if(const char *Slash = findLast(this->Filename[Depth], '/')){
|
if(const char *Slash = findLast(this->Filename[Depth], '/')){
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user