diff options
| author | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-23 09:10:25 +0000 |
|---|---|---|
| committer | Magnus Auvinen <magnus.auvinen@gmail.com> | 2008-03-23 09:10:25 +0000 |
| commit | a39b095919b49764e7549a652b2aad9e11808172 (patch) | |
| tree | 11ba083c0e915f209c1747a5a0a0e9e8619b9092 /src | |
| parent | f40300d1f2fb87a32bf1408da6a275ec0e6932b7 (diff) | |
| download | zcatch-a39b095919b49764e7549a652b2aad9e11808172.tar.gz zcatch-a39b095919b49764e7549a652b2aad9e11808172.zip | |
fixed overflow in the edit boxes
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/client/gc_menu.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
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) |