Some code improvements

This commit is contained in:
Markus Gans 2015-10-01 05:08:05 +02:00
parent 2ba6b0bcf7
commit b24c349204
2 changed files with 11 additions and 6 deletions

View File

@ -96,9 +96,12 @@ void FMenuItem::init (FWidget* parent)
if ( parent )
{
FMenuList* super_menu_list = dynamic_cast<FMenuList*>(parent);
setSuperMenu(super_menu_list);
super_menu_list->insert(this);
FMenuList* sm_list = dynamic_cast<FMenuList*>(parent);
if ( sm_list )
{
setSuperMenu(sm_list);
sm_list->insert(this);
}
if ( isMenuBar(parent) ) // Parent is menubar
{

View File

@ -412,7 +412,9 @@ int FOptiMove::relative_move ( char*& move
if ( F_column_address.cap )
{
strcat (hmove, tparm(F_column_address.cap, to_x));
strncat ( hmove
, tparm(F_column_address.cap, to_x)
, sizeof(hmove) - strlen(hmove) - 1 );
htime = F_column_address.duration;
}
@ -637,13 +639,13 @@ char* FOptiMove::cursor_move (int xold, int yold, int xnew, int ynew)
break;
case 2:
strcpy (move_ptr, F_carriage_return.cap);
strncpy (move_ptr, F_carriage_return.cap, sizeof(move_buf) - 1);
move_ptr += F_carriage_return.length;
relative_move (move_ptr, 0, yold, xnew, ynew);
break;
case 3:
strcpy (move_ptr, F_cursor_home.cap);
strncpy (move_ptr, F_cursor_home.cap, sizeof(move_buf) - 1);
move_ptr += F_cursor_home.length;
relative_move (move_ptr, 0, 0, xnew, ynew);
break;