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

Fix seg fault if loading more that NB_BUTT_MAX views

parent 48e8619b
Branches
Tags
No related merge requests found
// $Id: Options.cpp,v 1.35 2001-07-30 20:22:55 geuzaine Exp $ // $Id: Options.cpp,v 1.36 2001-07-31 22:20:05 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -507,7 +507,7 @@ char * opt_view_name(OPT_ARGS_STR){ ...@@ -507,7 +507,7 @@ char * opt_view_name(OPT_ARGS_STR){
if(action & GMSH_SET){ if(action & GMSH_SET){
strcpy(v->Name, val); strcpy(v->Name, val);
#ifdef _FLTK #ifdef _FLTK
if(WID){ if(WID && num<NB_BUTT_MAX){
WID->m_toggle_butt[num]->label(v->Name); WID->m_toggle_butt[num]->label(v->Name);
WID->m_toggle_butt[num]->redraw(); WID->m_toggle_butt[num]->redraw();
} }
...@@ -1708,7 +1708,7 @@ double opt_view_visible(OPT_ARGS_NUM){ ...@@ -1708,7 +1708,7 @@ double opt_view_visible(OPT_ARGS_NUM){
v->Visible = (int)val; v->Visible = (int)val;
} }
#ifdef _FLTK #ifdef _FLTK
if(WID && (action & GMSH_GUI)) if(WID && (action & GMSH_GUI) && num<NB_BUTT_MAX)
WID->m_toggle_butt[num]->value(v->Visible); WID->m_toggle_butt[num]->value(v->Visible);
#endif #endif
Msg(DEBUG1, "View %d", v->Num); Msg(DEBUG1, "View %d", v->Num);
......
// this tests that we can still load as many views as we want.
// (even if only 200 are allowed in the GUI)
For i In {0:250}
Include "../tutorial/view1.pos" ;
Include "../tutorial/view2.pos" ;
EndFor
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment