1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

utils/cert-expr.c: remove 'lasttoktext' field.

Coverity spotted me copying an uninitialised variable into it, which
made me wonder how I hadn't noticed. The answer is that nothing
actually _uses_ that variable - it's written, but never read. I must
have put it in during development, thinking I was going to need it for
something, and then didn't end up using it after all.
This commit is contained in:
Simon Tatham 2022-09-07 14:23:36 +01:00
parent 3442fb1aeb
commit ebaa37e159

View File

@ -347,7 +347,7 @@ typedef struct ParserState ParserState;
struct ParserState {
ptrlen currtext;
Token tok;
ptrlen toktext, lasttoktext;
ptrlen toktext;
char *err;
ptrlen errloc;
};
@ -365,7 +365,6 @@ static void error(ParserState *ps, char *errtext, ptrlen errloc)
static void advance(ParserState *ps)
{
char *err = NULL;
ps->lasttoktext = ps->toktext;
ps->tok = lex(&ps->currtext, &ps->toktext, &err);
if (ps->tok == TOK_ERROR)
error(ps, err, ps->toktext);
@ -542,7 +541,6 @@ static ExprNode *parse(ptrlen expr, char **error_msg, ptrlen *error_loc)
{
ParserState ps[1];
ps->currtext = expr;
ps->lasttoktext = make_ptrlen(ps->currtext.ptr, 0);
ps->err = NULL;
advance(ps);