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;
} else {
ret = -2;
Cmd_Error (va("Math error: invalid expression %s\n", statement->str));
break; // Math evaluation error
}
}
@ -1153,7 +1154,6 @@ Cmd_TokenizeString (const char *text, qboolean filter)
return;
}
if (res == -2) {
Cmd_Error ("Math error: Invalid math expression\n");
cmd_activebuffer->argc = 0;
return;
}

View File

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