Skip to content
Snippets Groups Projects
Commit 8160ecd3 authored by Wouter Klijn's avatar Wouter Klijn
Browse files

Use if with curly braces at all times

parent 0a31d40c
No related branches found
No related tags found
No related merge requests found
......@@ -143,13 +143,15 @@ std::istream& swc_parser::safe_getline(std::istream& is, std::string& t)
case '\n':
return is;
case '\r':
if (sb->sgetc() == '\n')
if (sb->sgetc() == '\n') {
sb->sbumpc();
}
return is;
case EOF:
// Also handle the case when the last line has no line ending
if (t.empty())
if (t.empty()) {
is.setstate(std::ios::eofbit);
}
return is;
default:
t += (char)c;
......@@ -165,7 +167,9 @@ std::istream &swc_parser::parse_record(std::istream &is, swc_record &record)
++lineno_;
if (!linebuff_.empty() && !starts_with(linebuff_, comment_prefix_))
{
break;
}
}
if (is.bad()) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment