Fix M_FindResponseFile returning garbage data

This commit is contained in:
Steel Titanium 2018-06-16 23:44:28 -04:00
parent 650e0eafce
commit 5af778ba7f

View file

@ -198,17 +198,16 @@ void M_FindResponseFile(void)
k++; k++;
} while (k < size); } while (k < size);
free(file);
for (k = 0; k < pindex; k++) for (k = 0; k < pindex; k++)
myargv[indexinfile++] = moreargs[k]; myargv[indexinfile++] = moreargs[k];
myargc = indexinfile; myargc = indexinfile;
// display arguments // display arguments
CONS_Printf(M_GetText("%d command-line args:\n"), myargc); CONS_Printf(M_GetText("%d command-line args:\n"), myargc-1); // -1 so @ don't actually get counted for
for (k = 1; k < myargc; k++) for (k = 1; k < myargc; k++)
CONS_Printf("%s\n", myargv[k]); CONS_Printf("%s\n", myargv[k]);
break; break;
free(file); // Needs to be called after everything else, or we would end up with garbage data
} }
} }