ErrorLogger: do not allocate huge std::string when column is -1

This commit is contained in:
Daniel Marjamäki 2022-07-07 15:07:17 +02:00
parent b44a38bf7f
commit 4719e725a1
1 changed files with 1 additions and 1 deletions

View File

@ -489,7 +489,7 @@ static std::string readCode(const std::string &file, int linenr, int column, con
std::string::size_type pos = 0;
while ((pos = line.find('\t', pos)) != std::string::npos)
line[pos] = ' ';
return line + endl + std::string((column>0 ? column-1 : column), ' ') + '^';
return line + endl + std::string((column>0 ? column-1 : 0), ' ') + '^';
}
static void replaceColors(std::string& source)