]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cmd.c
console parsing now behaves like qwcl, thanks to Fuh for pointing out the problems...
[xonotic/darkplaces.git] / cmd.c
diff --git a/cmd.c b/cmd.c
index 79f9137b340fca094f46741a66d385141a76726e..d2b0b115531d382e90ee2782b0d9143c7ff53baf 100644 (file)
--- a/cmd.c
+++ b/cmd.c
@@ -377,18 +377,18 @@ static void Cmd_Alias_f (void)
                a->next = cmd_alias;
                cmd_alias = a;
        }
-       strcpy (a->name, s);
+       strlcpy (a->name, s, sizeof (a->name));
 
 // copy the rest of the command line
        cmd[0] = 0;             // start out with a null string
        c = Cmd_Argc();
        for (i=2 ; i< c ; i++)
        {
-               strcat (cmd, Cmd_Argv(i));
+               strlcat (cmd, Cmd_Argv(i), sizeof (cmd));
                if (i != c)
-                       strcat (cmd, " ");
+                       strlcat (cmd, " ", sizeof (cmd));
        }
-       strcat (cmd, "\n");
+       strlcat (cmd, "\n", sizeof (cmd));
 
        a->value = CopyString (cmd);
 }
@@ -552,7 +552,7 @@ static void Cmd_TokenizeString (const char *text)
                if (cmd_argc == 1)
                         cmd_args = text;
 
-               if (!COM_ParseToken(&text, false))
+               if (!COM_ParseTokenConsole(&text))
                        return;
 
                if (cmd_argc < MAX_ARGS)