mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
two little bugfixes :)
This commit is contained in:
parent
e65c1bd7e1
commit
abd7d79d6b
2 changed files with 5 additions and 2 deletions
|
@ -125,7 +125,10 @@ GIB_Interpret_Inst (char *inst)
|
|||
if (ret)
|
||||
return ret;
|
||||
gib_argc = 0;
|
||||
for (i = 0; buffer3[i] != ' '; i++);
|
||||
for (i = 0; buffer3[i] != ' '; i++)
|
||||
if (buffer3[i] == '\0')
|
||||
return GIB_E_PARSE;
|
||||
|
||||
gib_argv[0] = malloc (i + 1);
|
||||
strncpy (gib_argv[0], buffer3, i);
|
||||
gib_argv[0][i] = 0;
|
||||
|
|
|
@ -38,7 +38,7 @@ GIB_InStack_Push (gib_inst_t * instruction, int argc, char **argv)
|
|||
|
||||
gib_instack =
|
||||
realloc (gib_instack, sizeof (gib_instack_t) * (gib_insp + 1));
|
||||
gib_instack[gib_insp].argv = malloc (argc + 1);
|
||||
gib_instack[gib_insp].argv = malloc ((argc + 1) * sizeof(char *));
|
||||
|
||||
for (i = 0; i <= argc; i++) {
|
||||
gib_instack[gib_insp].argv[i] = malloc (strlen (argv[i]) + 1);
|
||||
|
|
Loading…
Reference in a new issue