diff --git a/src/third_party/GMSHLexer.cpp b/src/third_party/GMSHLexer.cpp index ee400fe..d56fb93 100644 --- a/src/third_party/GMSHLexer.cpp +++ b/src/third_party/GMSHLexer.cpp @@ -23,9 +23,12 @@ GMSHToken GMSHLexer::getToken() { return GMSHToken::eof; } - while (isspace(lastChar)) { + while (isspace(lastChar) && in->good()) { advance(); } + if (!in->good()) { + return GMSHToken::eof; + } if (lastChar == '$') { advance();