Mantis: 1071

o Fixed client command crash 


git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@197 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
puzl 2005-06-19 01:25:37 +00:00
parent 33b04e9f51
commit 2581c48cfc

View file

@ -655,7 +655,14 @@ void ClientCommand( edict_t *pEntity )
// max total length is 192 ...and we're adding a string below ("Unknown command: %s\n")
strncpy( command, pcmd, 127 );
command[127] = '\0';
// puzl: 1071
// Remove printf formatting
for ( int i=0; i < 127; i++ ) {
if ( command[i] == '%' ) {
command[i] = ' ';
}
}
// :puzl
// tell the user they entered an unknown command
ClientPrint( &pEntity->v, HUD_PRINTCONSOLE, UTIL_VarArgs( "Unknown command: %s\n", command ) );
}