Revert "Preprocessor:removeParentheses: fixed potential buffer access out of bounds, if find returns std::string::npos."

This reverts commit 4fbe15c866.

As far as I see there can't be buffer access out of bounds. line always contain a '('.
This commit is contained in:
Daniel Marjamäki 2013-12-15 13:41:07 +01:00
parent 31368d946b
commit a948b4f4b0
1 changed files with 2 additions and 5 deletions

View File

@ -819,12 +819,9 @@ std::string Preprocessor::removeParentheses(const std::string &str)
--ind;
if (ind == 0) {
if (i == line.length() - 1) {
const std::string::size_type posIndx = line.find('(');
if (posIndx != std::string::npos) {
line[posIndx] = ' ';
line[line.find('(')] = ' ';
line.erase(line.length() - 1);
}
}
break;
}
}