r512 - trunk/code/qcommon

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Fri Jan 20 20:35:42 EST 2006


Author: tma
Date: 2006-01-20 20:35:42 -0500 (Fri, 20 Jan 2006)
New Revision: 512

Modified:
   trunk/code/qcommon/common.c
Log:
* Fix a bug with command/cvar autocompletion


Modified: trunk/code/qcommon/common.c
===================================================================
--- trunk/code/qcommon/common.c	2006-01-20 01:14:44 UTC (rev 511)
+++ trunk/code/qcommon/common.c	2006-01-21 01:35:42 UTC (rev 512)
@@ -2934,7 +2934,12 @@
 	}
 
 	// cut shortestMatch to the amount common with s
-	for ( i = 0 ; s[i] ; i++ ) {
+	for ( i = 0 ; shortestMatch[i] ; i++ ) {
+		if ( i >= strlen( s ) ) {
+			shortestMatch[i] = 0;
+			break;
+		}
+
 		if ( tolower(shortestMatch[i]) != tolower(s[i]) ) {
 			shortestMatch[i] = 0;
 		}




More information about the quake3-commits mailing list