BUG: Fix invalid array access discovered during investigation of issue #7832.

This commit is contained in:
David Cole 2009-04-07 15:13:07 -04:00
parent 36e9a6ed81
commit f6828c391d
1 changed files with 1 additions and 1 deletions

View File

@ -1232,7 +1232,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
}
std::string flags = includeFlags.str();
// remove trailing separators
if((sep[0] != ' ') && flags[flags.size()-1] == sep[0])
if((sep[0] != ' ') && flags.size()>0 && flags[flags.size()-1] == sep[0])
{
flags[flags.size()-1] = ' ';
}