#include "quakedef.h"
#define MAX_ALIAS_NAME 32
+// this is the largest script file that can be executed in one step
+// LordHavoc: inreased this from 8192 to 32768
+#define CMDBUFSIZE 32768
+// maximum number of parameters to a command
+#define MAX_ARGS 80
+// maximum tokenizable commandline length (counting NUL terminations)
+#define CMD_TOKENIZELENGTH (MAX_INPUTLINE + 80)
typedef struct cmdalias_s
{
static mempool_t *cmd_mempool;
-#define CMD_TOKENIZELENGTH 4096
static char cmd_tokenizebuffer[CMD_TOKENIZELENGTH];
static int cmd_tokenizebufferpos = 0;
=============================================================================
*/
- // LordHavoc: inreased this from 8192 to 32768
static sizebuf_t cmd_text;
-static unsigned char cmd_text_buf[32768];
+static unsigned char cmd_text_buf[CMDBUFSIZE];
/*
============
static void Cmd_PreprocessString( const char *intext, char *outtext, unsigned maxoutlen, cmdalias_t *alias );
void Cbuf_Execute (void)
{
-#define EXECUTESTRING_BUFFER 2048
int i;
char *text;
- char line[1024];
- char preprocessed[EXECUTESTRING_BUFFER];
+ char line[MAX_INPUTLINE];
+ char preprocessed[MAX_INPUTLINE];
int quotes;
// LordHavoc: making sure the tokenizebuffer doesn't get filled up by repeated crashes
}
// execute the command line
- Cmd_PreprocessString( line, preprocessed, EXECUTESTRING_BUFFER, NULL );
+ Cmd_PreprocessString( line, preprocessed, sizeof(preprocessed), NULL );
Cmd_ExecuteString (preprocessed, src_command);
if (cmd_wait)
{
int i, j, l;
// this is per command, and bounds checked (no buffer overflows)
- char build[2048];
+ char build[MAX_INPUTLINE];
if (Cmd_Argc () != 1)
{
static void Cmd_Alias_f (void)
{
cmdalias_t *a;
- char cmd[1024];
+ char cmd[MAX_INPUTLINE];
int i, c;
const char *s;
xcommand_t function;
} cmd_function_t;
-
-#define MAX_ARGS 80
-
static int cmd_argc;
static const char *cmd_argv[MAX_ARGS];
static const char *cmd_null_string = "";
*/
static void Cmd_ExecuteAlias (cmdalias_t *alias)
{
-#define ALIAS_BUFFER 1024
- static char buffer[ ALIAS_BUFFER + 2 ];
- Cmd_PreprocessString( alias->value, buffer, ALIAS_BUFFER, alias );
+ static char buffer[ MAX_INPUTLINE + 2 ];
+ Cmd_PreprocessString( alias->value, buffer, sizeof(buffer) - 2, alias );
Cbuf_AddText( buffer );
}