Fixed a double free in exp.c, and made math error reports slightly more

useful.
This commit is contained in:
Brian Koropoff 2002-03-22 07:11:05 +00:00
parent e1b61d2116
commit 73f32465c5
2 changed files with 1 additions and 2 deletions

View file

@ -1016,6 +1016,7 @@ Cmd_ProcessMath (dstring_t * dstr)
i += strlen (temp) - 1; i += strlen (temp) - 1;
} else { } else {
ret = -2; ret = -2;
Cmd_Error (va("Math error: invalid expression %s\n", statement->str));
break; // Math evaluation error break; // Math evaluation error
} }
} }
@ -1153,7 +1154,6 @@ Cmd_TokenizeString (const char *text, qboolean filter)
return; return;
} }
if (res == -2) { if (res == -2) {
Cmd_Error ("Math error: Invalid math expression\n");
cmd_activebuffer->argc = 0; cmd_activebuffer->argc = 0;
return; return;
} }

View file

@ -272,7 +272,6 @@ exp_error_t EXP_Validate (token *chain)
EXP_InsertTokenAfter (cur, new); EXP_InsertTokenAfter (cur, new);
} }
else else
EXP_DestroyTokens (chain);
return EXP_E_SYNTAX; /* Operator misuse */ return EXP_E_SYNTAX; /* Operator misuse */
} }
else if (cur->generic.type == TOKEN_NUM && cur->generic.next->generic.type == TOKEN_NUM) else if (cur->generic.type == TOKEN_NUM && cur->generic.next->generic.type == TOKEN_NUM)