Timeline: Don't die if user selects nonsense item from Control Sequence Connect To menu.

This commit is contained in:
Jonathan Moore Liles 2013-04-11 17:44:34 -07:00
parent ec09f027d6
commit 9501e52d54
1 changed files with 1 additions and 2 deletions

View File

@ -511,14 +511,13 @@ Control_Sequence::menu_cb ( const Fl_Menu_ *m )
DMESSAGE( "Control_Sequence: menu_cb" ); DMESSAGE( "Control_Sequence: menu_cb" );
if ( ! m->mvalue() ) // || m->mvalue()->flags & FL_SUBMENU_POINTER || m->mvalue()->flags & FL_SUBMENU ) if ( ! m->mvalue() || m->mvalue()->flags & ( FL_SUBMENU_POINTER | FL_SUBMENU ))
return; return;
m->item_pathname( picked, sizeof( picked ), m->mvalue() ); m->item_pathname( picked, sizeof( picked ), m->mvalue() );
if ( ! strncmp( picked, "Connect To/", strlen( "Connect To/" ) ) ) if ( ! strncmp( picked, "Connect To/", strlen( "Connect To/" ) ) )
{ {
char *peer_name = index( picked, '/' ) + 1; char *peer_name = index( picked, '/' ) + 1;
*index( peer_name, '/' ) = 0; *index( peer_name, '/' ) = 0;