From f146092d622b58d8d224f8763c521494555e65d6 Mon Sep 17 00:00:00 2001 From: "M. Kristall" Date: Thu, 27 Jan 2011 07:42:36 +0000 Subject: * Fix OB1 * Prevent name matches when the search term contains only ignored characters * Strings are not likely to have lengths less than 0 --- src/game/g_cmds.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/game') diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c index 57e52a3b..3ef818ab 100644 --- a/src/game/g_cmds.c +++ b/src/game/g_cmds.c @@ -106,7 +106,8 @@ int G_ClientNumberFromString( char *s, char *err, int len ) // check for a name match G_SanitiseString( s, s2, sizeof( s2 ) ); - + if( !s2[ 0 ] ) + return -1; for( i = 0, cl = level.clients; i < level.maxclients; i++, cl++ ) { if( cl->pers.connected == CON_DISCONNECTED ) @@ -183,7 +184,7 @@ int G_ClientNumbersFromString( char *s, int *plist, int max ) // now look for name matches G_SanitiseString( s, s2, sizeof( s2 ) ); - if( strlen( s2 ) < 1 ) + if( !s2[ 0 ] ) return 0; for( i = 0; i < level.maxclients && found < max; i++ ) { @@ -267,7 +268,7 @@ void ScoreboardMessage( gentity_t *ent ) j = strlen( entry ); - if( stringlength + j > 1024 ) + if( stringlength + j >= 1024 ) break; strcpy( string + stringlength, entry ); -- cgit