diff options
Diffstat (limited to 'code/qcommon/cmd.c')
-rw-r--r-- | code/qcommon/cmd.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/code/qcommon/cmd.c b/code/qcommon/cmd.c index 08af301..8b14c2a 100644 --- a/code/qcommon/cmd.c +++ b/code/qcommon/cmd.c @@ -434,6 +434,22 @@ char *Cmd_Cmd(void) } /* + Replace command separators with space to prevent interpretation + This is a hack to protect buggy qvms + https://bugzilla.icculus.org/show_bug.cgi?id=3593 +*/ +void Cmd_Args_Sanitize( void ) { + int i; + for ( i = 1 ; i < cmd_argc ; i++ ) { + char* c = cmd_argv[i]; + while ((c = strpbrk(c, "\n\r;"))) { + *c = ' '; + ++c; + } + } +} + +/* ============ Cmd_TokenizeString |