Lots of str[n]cat, str[n]cpy, and [v]sprintf have been replaced by strlcat, strlcpy...
[xonotic/darkplaces.git] / cmd.c
diff --git a/cmd.c b/cmd.c
index 79f9137..b6436b3 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);
 }