From 8051d32adc646a1580d43a38253fd5eddb3932e6 Mon Sep 17 00:00:00 2001 From: vejmarie Date: Fri, 15 Jul 2016 19:38:34 +0200 Subject: [PATCH] Fix UNV file read which was broken due to missing cards --- src/3rdParty/salomesmesh/inc/UNV_Utilities.hxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/3rdParty/salomesmesh/inc/UNV_Utilities.hxx b/src/3rdParty/salomesmesh/inc/UNV_Utilities.hxx index 413ccfa5a..98181a60a 100644 --- a/src/3rdParty/salomesmesh/inc/UNV_Utilities.hxx +++ b/src/3rdParty/salomesmesh/inc/UNV_Utilities.hxx @@ -60,7 +60,7 @@ namespace UNV{ std::string olds, news; in_file.seekg(0); - while(true) + while(!in_file.eof() && !in_file.fail()) { in_file >> olds >> news; /* @@ -81,7 +81,9 @@ namespace UNV{ if (news == ds_name) return true; } - // should never end up here + // We didn't found the card + // Let's rewind the file handler and return an error + in_file.clear(); return false; }