diff options
Diffstat (limited to 'Source/cmStringCommand.cxx')
-rw-r--r-- | Source/cmStringCommand.cxx | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index 93aa083..9827c62 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -743,12 +743,10 @@ bool cmStringCommand::HandleSubstringCommand(std::vector<std::string> const& this->SetError(ostr.str()); return false; } - int leftOverLength = intStringLength - begin; - if ( end < -1 || end > leftOverLength ) + if ( end < -1 ) { cmOStringStream ostr; - ostr << "end index: " << end << " is out of range -1 - " - << leftOverLength; + ostr << "end index: " << end << " should be -1 or greater"; this->SetError(ostr.str()); return false; } @@ -814,7 +812,7 @@ bool cmStringCommand const std::string& variableName = args[2]; this->Makefile->AddDefinition(variableName, - cmSystemTools::MakeCidentifier(input.c_str()).c_str()); + cmSystemTools::MakeCidentifier(input).c_str()); return true; } |