summaryrefslogtreecommitdiff
path: root/textscreen/txt_table.c
diff options
context:
space:
mode:
authorSimon Howard2006-09-19 21:13:56 +0000
committerSimon Howard2006-09-19 21:13:56 +0000
commit3dd7131d4104f935590eff6e0b9b3a51a7a34dff (patch)
tree5334e6dcaab7e1c427f4d500c80c6b0362692531 /textscreen/txt_table.c
parent7a757b5c2422e9e834914207553463de11dc39a5 (diff)
downloadchocolate-doom-3dd7131d4104f935590eff6e0b9b3a51a7a34dff.tar.gz
chocolate-doom-3dd7131d4104f935590eff6e0b9b3a51a7a34dff.tar.bz2
chocolate-doom-3dd7131d4104f935590eff6e0b9b3a51a7a34dff.zip
Check column is valid when finding a selectable column. Fixes weird
scrolling behavior. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 620
Diffstat (limited to 'textscreen/txt_table.c')
-rw-r--r--textscreen/txt_table.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/textscreen/txt_table.c b/textscreen/txt_table.c
index d1d0777e..b04ce7cb 100644
--- a/textscreen/txt_table.c
+++ b/textscreen/txt_table.c
@@ -169,6 +169,11 @@ static int SelectableWidget(txt_table_t *table, int x, int y)
txt_widget_t *widget;
int i;
+ if (x < 0 || x >= table->columns)
+ {
+ return 0;
+ }
+
i = y * table->columns + x;
if (i >= 0 && i < table->num_widgets)