Preprocessor: Fix buffer overflow if line is empty

This commit is contained in:
Daniel Marjamäki 2015-07-24 19:19:07 +02:00
parent 9910c1fa0c
commit f939381673
1 changed files with 1 additions and 1 deletions

View File

@ -785,7 +785,7 @@ std::string Preprocessor::removeParentheses(const std::string &str)
std::ostringstream ret;
std::string line;
while (std::getline(istr, line)) {
if ((line[0] == '#') && (line.compare(0, 3, "#if") == 0 || line.compare(0, 5, "#elif") == 0)) {
if (line.compare(0, 3, "#if") == 0 || line.compare(0, 5, "#elif") == 0) {
std::string::size_type pos;
pos = 0;
while ((pos = line.find(" (", pos)) != std::string::npos)