mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Command_Addfile: Only allocate after argc is sanity checked
This commit is contained in:
parent
8bc610bf40
commit
933faf1d9d
1 changed files with 3 additions and 4 deletions
|
|
@ -4314,16 +4314,15 @@ static void Command_Addfile(void)
|
||||||
size_t argc = COM_Argc(); // amount of arguments total
|
size_t argc = COM_Argc(); // amount of arguments total
|
||||||
size_t curarg; // current argument index
|
size_t curarg; // current argument index
|
||||||
|
|
||||||
const char **addedfiles = Z_Calloc(sizeof(const char*) * argc, PU_STATIC, NULL);
|
|
||||||
size_t numfilesadded = 0; // the amount of filenames processed
|
|
||||||
|
|
||||||
if (argc < 2)
|
if (argc < 2)
|
||||||
{
|
{
|
||||||
CONS_Printf(M_GetText("addfile <filename.pk3/wad/lua/soc> [filename2...] [...]: Load add-ons\n"));
|
CONS_Printf(M_GetText("addfile <filename.pk3/wad/lua/soc> [filename2...] [...]: Load add-ons\n"));
|
||||||
Z_Free(addedfiles);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char **addedfiles = Z_Calloc(sizeof(const char*) * argc, PU_STATIC, NULL);
|
||||||
|
size_t numfilesadded = 0; // the amount of filenames processed
|
||||||
|
|
||||||
// start at one to skip command name
|
// start at one to skip command name
|
||||||
for (curarg = 1; curarg < argc; curarg++)
|
for (curarg = 1; curarg < argc; curarg++)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue