Check for CR in correct string.

This commit is contained in:
Brandon Wright 2019-01-08 20:17:08 -06:00
parent 4207ddc9d2
commit 8c24f6d49f
1 changed files with 4 additions and 4 deletions

View File

@ -64,15 +64,15 @@ std::vector<std::string> read_file_lines(const char *filename)
std::string string_contents(file_contents);
delete[] file_contents;
std::istringstream ss(string_contents);
std::string line;
for (char &c : line)
for (char &c : string_contents)
{
if (c == '\r')
c = '\n';
}
std::istringstream ss(string_contents);
std::string line;
while (std::getline(ss, line, '\n'))
if (!line.empty())
lines.push_back(line);