From a39b095919b49764e7549a652b2aad9e11808172 Mon Sep 17 00:00:00 2001 From: Magnus Auvinen Date: Sun, 23 Mar 2008 09:10:25 +0000 Subject: fixed overflow in the edit boxes --- src/game/client/gc_menu.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/game/client') diff --git a/src/game/client/gc_menu.cpp b/src/game/client/gc_menu.cpp index 446d42a6..f4573b51 100644 --- a/src/game/client/gc_menu.cpp +++ b/src/game/client/gc_menu.cpp @@ -210,15 +210,17 @@ int ui_do_edit_box(void *id, const RECT *rect, char *str, int str_size, float fo } } - if (at_index > len) - at_index = len; - for(int i = 0; i < inp_num_events(); i++) { INPUT_EVENT e = inp_get_event(i); char c = e.ch; int k = e.key; + if (at_index > len) + at_index = len; + + + if (!(c >= 0 && c < 32)) { if (len < str_size - 1 && at_index < str_size - 1) -- cgit 1.4.1