From 2581c48cfcd1b303d93eb44b99da521e5ba5dbbb Mon Sep 17 00:00:00 2001 From: puzl Date: Sun, 19 Jun 2005 01:25:37 +0000 Subject: [PATCH] Mantis: 1071 o Fixed client command crash git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@197 67975925-1194-0748-b3d5-c16f83f1a3a1 --- main/source/dlls/client.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main/source/dlls/client.cpp b/main/source/dlls/client.cpp index a38f2fd9..bbc4895e 100644 --- a/main/source/dlls/client.cpp +++ b/main/source/dlls/client.cpp @@ -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 ) ); }