Fix example

This commit is contained in:
Andreas Fabri 2019-03-20 16:11:48 +01:00
parent f1dceb79ee
commit 99a16d2c8f
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ bool read_vertices(const PolyMesh& mesh,
Vd_array& fixed_vertices)
{
std::string str = filename;
if(str.substr(str.length() - 14) != ".selection.txt") {
if( (str.length()) < 14 || (str.substr(str.length() - 14) != ".selection.txt") ) {
std::cerr << "Error: vertices must be given by a *.selection.txt file" << std::endl;
return false;
}