when i run this code, f is being set to null and i have no idea why..
i know for a fact that cmd.argv(1) at that point is "vars.rc" because i debugged it
with breakpoints.
FILE *f;
if(cmd.argc() != 2)
{
con.printf("writevars: <filename>\n");
return;
}
f = fopen(cmd.argv(1), "w");
if(!f)
{
con.printf("could not open file %s\n", cmd.argv(1));
return;
}
cvar.writevariables(f);
fclose(f);
con.printf("vars written to %s\n", cmd.argv(1));