Skip to content
Snippets Groups Projects
Commit 677c9eed authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix crash in face/region info string

parent fb0dfd25
No related branches found
No related tags found
No related merge requests found
......@@ -159,14 +159,13 @@ std::string GFace::getAdditionalInfoString()
if(l_edges.empty()) return std::string("");
std::string str("{");
std::list<GEdge*>::const_iterator it = l_edges.begin();
if(l_edges.size() > 10){
std::list<GEdge*>::const_iterator ite = l_edges.end();
char tmp[256];
sprintf(tmp, "%d, ..., %d", (*it)->tag(), (*ite)->tag());
sprintf(tmp, "%d, ..., %d", l_edges.front()->tag(), l_edges.back()->tag());
str += tmp;
}
else{
std::list<GEdge*>::const_iterator it = l_edges.begin();
for(; it != l_edges.end(); it++){
if(it != l_edges.begin()) str += ",";
char tmp[256];
......
......@@ -130,20 +130,21 @@ std::string GRegion::getAdditionalInfoString()
{
if(l_faces.empty()) return std::string("");
char tmp[256];
std::string str("{");
if(l_faces.size() > 10){
sprintf(tmp, "{%d, ..., %d}", (*l_faces.begin())->tag(), (*l_faces.end())->tag());
return std::string(tmp);
}
std::string str("");
std::list<GFace*>::const_iterator it = l_faces.begin();
str += "{";
for(; it != l_faces.end(); it++){
if(it != l_faces.begin()) str += ",";
sprintf(tmp, "%d", (*it)->tag());
char tmp[256];
sprintf(tmp, "%d, ..., %d", l_faces.front()->tag(), l_faces.back()->tag());
str += tmp;
}
else{
std::list<GFace*>::const_iterator it = l_faces.begin();
for(; it != l_faces.end(); it++){
if(it != l_faces.begin()) str += ",";
char tmp[256];
sprintf(tmp, "%d", (*it)->tag());
str += tmp;
}
}
str += "}";
return str;
}
......
......@@ -101,4 +101,4 @@ Dardenne, Christophe Prud'homme, Sebastien.Clerc, Jose Miguel Pasini,
Philippe Lussou, Jacques Kools, Bayram Yenikaya, Peter Hornby, Krishna
Mohan Gundu, Christopher Stott, Timmy Schumacher, Carl Osterwisch,
Bruno Frackowiak, Philip Kelleners, Romuald Conty, Ruth Sabariego,
Renaud Sizaire, Michel Benhamou, Emilie Marchandise.
Renaud Sizaire, Michel Benhamou, Emilie Marchandise, Tom De Vuyst.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment