// Optional values
B = C = J = F = 0;
- if (f.peek() == ' ') {
- if (!(f >> B >> C >> J >> F))
- log_error("Invalid AIGER header\n");
- }
+ if (f.peek() != ' ') goto parse_body;
+ if (!(f >> B)) log_error("Invalid AIGER header\n");
+ if (f.peek() != ' ') goto parse_body;
+ if (!(f >> C)) log_error("Invalid AIGER header\n");
+ if (f.peek() != ' ') goto parse_body;
+ if (!(f >> J)) log_error("Invalid AIGER header\n");
+ if (f.peek() != ' ') goto parse_body;
+ if (!(f >> F)) log_error("Invalid AIGER header\n");
+
+parse_body:
std::string line;
std::getline(f, line); // Ignore up to start of next line, as standard