On Mon, Nov 04, 2019 at 10:46:44PM +0100, Luc Van Oostenryck wrote: > On Fri, Nov 01, 2019 at 04:36:51PM +0000, Ben Dooks wrote: > > I've put the latest code up at: > > > > https://github.com/bjdooks-ct/sparse bjdooks/printf20 > > > > I think it has all the issues dealt with. > > > > I can't currently post or do a final test as away from work laptop. > > Thank you. > > I've a few more remarks about formatting or naming and > also some simplifications I would like you make. s/head/args/ in order to use the same variable name everywhere in your checks. >From cf2e3f8fa9ddba85c14ee40b2191fd702a907c2f Mon Sep 17 00:00:00 2001 From: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> Date: Mon, 4 Nov 2019 18:10:25 +0100 Subject: [PATCH 5/7] s/head/args/ --- evaluate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/evaluate.c b/evaluate.c index 76b37e045..fc340c2c3 100644 --- a/evaluate.c +++ b/evaluate.c @@ -2712,7 +2712,7 @@ static int parse_format_printf(const char **fmtstring, * in the parser code which stores the positions of the message and arg * start in the ctype. */ -static void evaluate_format_printf(struct symbol *fn, struct expression_list *head) +static void evaluate_format_printf(struct symbol *fn, struct expression_list *args) { struct format_state state = { }; struct expression *expr; @@ -2722,7 +2722,7 @@ static void evaluate_format_printf(struct symbol *fn, struct expression_list *he if (!fn->ctype.format.index) return; - expr = get_nth_expression(head, fn->ctype.format.index-1); + expr = get_nth_expression(args, fn->ctype.format.index-1); if (!expr) return; @@ -2750,7 +2750,7 @@ static void evaluate_format_printf(struct symbol *fn, struct expression_list *he continue; } - if (parse_format_printf(&string, &state, head) < 0) + if (parse_format_printf(&string, &state, args) < 0) fail++; } -- 2.23.0