From ebaa37e1590e77644aa5d0c9a85506f18b9bf38b Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 7 Sep 2022 14:23:36 +0100 Subject: [PATCH] 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. --- utils/cert-expr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/utils/cert-expr.c b/utils/cert-expr.c index 8fe8df7c..880239e4 100644 --- a/utils/cert-expr.c +++ b/utils/cert-expr.c @@ -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);