From 8a88750cd880cd830790e27d40f9e027d9b7f256 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sun, 20 Nov 2011 10:42:13 +0400 Subject: [PATCH] preproc: Proper bracing with list_for_each It is a potential place for a bug if list_for_each helper is used with multiple lines of code without a proper bracing. Signed-off-by: Cyrill Gorcunov --- preproc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/preproc.c b/preproc.c index 76b0ac16..b21335e9 100644 --- a/preproc.c +++ b/preproc.c @@ -4461,9 +4461,10 @@ again: * all, then think about checking for parameters if * necessary. */ - list_for_each(m, head) + list_for_each(m, head) { if (!mstrcmp(m->name, mname, m->casesense)) break; + } if (m) { mstart = tline; params = NULL; @@ -4827,9 +4828,10 @@ static ExpDef *is_mmacro(Token * tline, Token *** params_array) * count the parameters, and then we look further along the * list if necessary to find the proper ExpDef. */ - list_for_each(ed, head) + list_for_each(ed, head) { if (!mstrcmp(ed->name, tline->text, ed->casesense)) break; + } if (!ed) return NULL; @@ -4882,9 +4884,10 @@ static ExpDef *is_mmacro(Token * tline, Token *** params_array) * This one wasn't right: look for the next one with the * same name. */ - list_for_each(ed, ed->next) + list_for_each(ed, ed->next) { if (!mstrcmp(ed->name, tline->text, ed->casesense)) break; + } } /* -- 2.11.4.GIT