Commit f47d8894 authored by Martin Heistermann's avatar Martin Heistermann
Browse files

Avoid endless loop on invalid files

parent d7ccc04d
Pipeline #8467 passed with stage
in 6 minutes and 58 seconds
...@@ -154,7 +154,7 @@ bool FileManager::isHexahedralMesh(const std::string& _filename) const { ...@@ -154,7 +154,7 @@ bool FileManager::isHexahedralMesh(const std::string& _filename) const {
unsigned int n = 0u; unsigned int n = 0u;
// Skip until we find polyhedra section // Skip until we find polyhedra section
while (true || !iff.eof()) { while (iff.good()) {
iff >> s; iff >> s;
if (s == "Polyhedra") { if (s == "Polyhedra") {
break; break;
...@@ -200,7 +200,7 @@ bool FileManager::isTetrahedralMesh(const std::string& _filename) const { ...@@ -200,7 +200,7 @@ bool FileManager::isTetrahedralMesh(const std::string& _filename) const {
unsigned int n = 0u; unsigned int n = 0u;
// Skip until we find polyhedra section // Skip until we find polyhedra section
while (true || !iff.eof()) { while (iff.good()) {
iff >> s; iff >> s;
if (s == "Polyhedra") { if (s == "Polyhedra") {
break; break;
......
Markdown is supported
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