X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGeomAlgoAPI%2FGeomAlgoAPI_Tools.cpp;h=3bdecb71dbe2f8b02283869f95f5cb9664d81843;hb=f1fdc6c4b73b4f4c80c83c5a795e370ab0d7fc26;hp=9f7f5ec7848bf162c2355050222202457f16e86d;hpb=97917d3698f5a2f7fc9596e7c755ff8f6751e373;p=modules%2Fshaper.git diff --git a/src/GeomAlgoAPI/GeomAlgoAPI_Tools.cpp b/src/GeomAlgoAPI/GeomAlgoAPI_Tools.cpp index 9f7f5ec78..3bdecb71d 100644 --- a/src/GeomAlgoAPI/GeomAlgoAPI_Tools.cpp +++ b/src/GeomAlgoAPI/GeomAlgoAPI_Tools.cpp @@ -1,4 +1,4 @@ -// Copyright (C) 2014-2019 CEA/DEN, EDF R&D +// Copyright (C) 2014-2021 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -45,6 +45,8 @@ std::string File_Tools::extension(const std::string& theFileName) TCollection_AsciiString aFileName(theFileName.c_str()); OSD_Path aPath(aFileName); TCollection_AsciiString anExtension = aPath.Extension(); + if (anExtension.Length() < 2) + return ""; // TCollection_AsciiString are numbered from 1 anExtension = anExtension.SubString(2, anExtension.Length()); anExtension.UpperCase(); @@ -74,14 +76,14 @@ bool AlgoError::isAlgorithmFailed(const GeomMakeShapePtr& theAlgorithm, if (!theAlgorithm->shape() || theAlgorithm->shape()->isNull()) { theError = "Error: Resulting shape"; if (!theFeature.empty()) - theError += "of " + theFeature; + theError += " of " + theFeature; theError += " is Null."; return true; } if (!theAlgorithm->isValid()) { theError = "Error: Resulting shape"; if (!theFeature.empty()) - theError += "of " + theFeature; + theError += " of " + theFeature; theError += " is not valid."; return true; }