fix loading of short mesh file names

This commit is contained in:
Christopher Lackner 2021-06-22 11:57:30 +02:00
parent 3165e04240
commit e0f3ce9cf0

View File

@ -150,7 +150,7 @@ void Ng_LoadMesh (const char * filename, ngcore::NgMPI_Comm comm)
mesh->SetCommunicator(comm); mesh->SetCommunicator(comm);
string fn(filename); string fn(filename);
if (fn.substr (fn.length()-8, 8) == ".vol.bin") if (fn.length() > 8 && fn.substr (fn.length()-8, 8) == ".vol.bin")
{ {
mesh -> Load(fn); mesh -> Load(fn);
SetGlobalMesh (mesh); SetGlobalMesh (mesh);