From 99a16d2c8f111d5f858e11852999b0cbcdaf5dd8 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Wed, 20 Mar 2019 16:11:48 +0100 Subject: [PATCH] Fix example --- .../square_border_parameterizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/square_border_parameterizer.cpp b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/square_border_parameterizer.cpp index 8cc315c599e..1cb769ced47 100644 --- a/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/square_border_parameterizer.cpp +++ b/Surface_mesh_parameterization/examples/Surface_mesh_parameterization/square_border_parameterizer.cpp @@ -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; }