about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-23 09:10:25 +0000
committerMagnus Auvinen <magnus.auvinen@gmail.com>2008-03-23 09:10:25 +0000
commita39b095919b49764e7549a652b2aad9e11808172 (patch)
tree11ba083c0e915f209c1747a5a0a0e9e8619b9092
parentf40300d1f2fb87a32bf1408da6a275ec0e6932b7 (diff)
downloadzcatch-a39b095919b49764e7549a652b2aad9e11808172.tar.gz
zcatch-a39b095919b49764e7549a652b2aad9e11808172.zip
fixed overflow in the edit boxes
-rw-r--r--src/game/client/gc_menu.cpp8
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)