From 999e637bc124e31661195f977e76751082ea161f Mon Sep 17 00:00:00 2001 From: Spoike Date: Sat, 15 Jan 2005 20:50:02 +0000 Subject: [PATCH] Hmm, can't have variably increased plugin function names if the cmd code uses pointers to the function names. This'll help emulated stuff work better. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@784 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/cmd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engine/common/cmd.c b/engine/common/cmd.c index 09a30d709..b7a22eca7 100644 --- a/engine/common/cmd.c +++ b/engine/common/cmd.c @@ -1245,8 +1245,9 @@ qboolean Cmd_AddRemCommand (char *cmd_name, xcommand_t function) } } - cmd = Z_Malloc (sizeof(cmd_function_t)); - cmd->name = cmd_name; + cmd = Z_Malloc (sizeof(cmd_function_t)+strlen(cmd_name)+1); + cmd->name = (char*)(cmd+1); + strcpy(cmd->name, cmd_name); cmd->function = function; cmd->next = cmd_functions; cmd->restriction = 0;