summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2011-01-27 07:42:36 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:17:55 +0000
commitf146092d622b58d8d224f8763c521494555e65d6 (patch)
tree87ad6b942f8b3aa3d4cc43283e4208cffc1fcdd9 /src
parentba7275f331505ce00a674613c6edb1aa303f92de (diff)
* Fix OB1
* Prevent name matches when the search term contains only ignored characters * Strings are not likely to have lengths less than 0
Diffstat (limited to 'src')
-rw-r--r--src/game/g_cmds.c7
1 files changed, 4 insertions, 3 deletions
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 );