--- afd-1.3.6/src/UI/Motif/afd_ctrl/mouse_handler.c.old 2007-11-18 08:57:44.000000000 +0100 +++ afd-1.3.6/src/UI/Motif/afd_ctrl/mouse_handler.c 2008-02-26 09:25:09.000000000 +0100 @@ -216,7 +216,8 @@ column--; select_no = (event->xbutton.y / line_height) + (column * no_of_rows); - if ((select_no < no_of_long_lines) && (last_motion_pos != select_no)) + if ((select_no < no_of_long_lines) && (last_motion_pos != select_no) && + (select_no > -1)) { int pos; @@ -282,7 +283,7 @@ select_no = (event->xbutton.y / line_height) + (column * no_of_rows); /* Make sure that this field does contain a channel */ - if (select_no < no_of_long_lines) + if ((select_no < no_of_long_lines) && (select_no > -1)) { int pos; @@ -500,7 +501,7 @@ select_no = (event->xbutton.y / line_height) + (column * no_of_rows); /* Make sure that this field does contain a channel */ - if (select_no < no_of_long_lines) + if ((select_no < no_of_long_lines) && (select_no > -1)) { int pos, x_pos, @@ -734,7 +735,7 @@ select_no = (event->xbutton.y / line_height) + (column * no_of_rows); /* Make sure that this field does contain a channel. */ - if (select_no < no_of_long_lines) + if ((select_no < no_of_long_lines) && (select_no > -1)) { (void)to_short(-1, select_no, YES); } @@ -759,7 +760,8 @@ { select_no = ((event->xbutton.y / line_height) * no_of_short_columns) + (event->xbutton.x / short_line_length); - if ((select_no < no_of_short_lines) && (last_motion_pos != select_no)) + if ((select_no < no_of_short_lines) && (last_motion_pos != select_no) && + (select_no > -1)) { int pos; @@ -817,7 +819,7 @@ (event->xbutton.x / short_line_length); /* Make sure that this field does contain a channel */ - if (select_no < no_of_short_lines) + if ((select_no < no_of_short_lines) && (select_no > -1)) { int pos; @@ -967,7 +969,7 @@ (event->xbutton.x / short_line_length); /* Make sure that this field does contain a channel. */ - if (select_no < no_of_short_lines) + if ((select_no < no_of_short_lines) && (select_no > -1)) { (void)to_long(-1, select_no, YES); }