diff --git a/src/life.cpp b/src/life.cpp index e6d5e09..ce7ebf3 100755 --- a/src/life.cpp +++ b/src/life.cpp @@ -188,16 +188,20 @@ int main() { return 1; } - if (lines.size() - 2 < rows) { - std::cerr << "There's less rows than described in the header!" << std::endl; + int possibleRows = lines.size() - 2; + if (possibleRows < rows) { + std::cerr << "There's less rows (" << possibleRows + << ") than described in the header! (" << rows << ')' + << std::endl; return 1; } Grid grid(columns, rows); for (int x = 0; x < rows; x++) { std::string &row = lines[x + 2]; - if (columns < row.size()) { - std::cerr << "There's less columns, than described in the header!" + if (columns > row.size()) { + std::cerr << "There's less columns (" << row.size() + << "), than described in the header! (" << rows << ')' << std::endl; return 1; }