From: Pietro Cerutti Date: Fri, 24 Aug 2018 06:57:31 +0000 (+0000) Subject: Chase a coverity wraning by using the correct STAILQ macro X-Git-Tag: 2019-10-25~683 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dc634ee27a8ada956eb0c29f92608514f1756d06;p=neomutt Chase a coverity wraning by using the correct STAILQ macro ________________________________________________________________________________________________________ *** CID 187781: Control flow issues (DEADCODE) /mutt/regex.c: 142 in mutt_regexlist_add() 136 mutt_buffer_printf(err, "Bad regex: %s\n", str); 137 return -1; 138 } 139 140 /* check to make sure the item is not already on this rl */ 141 struct RegexListNode *np = NULL; >>> CID 187781: Control flow issues (DEADCODE) >>> Execution cannot reach the expression "np" inside this statement: "np = (np ? np : rl->stqh_fi...". 142 STAILQ_FOREACH_FROM(np, rl, entries) 143 { 144 if (mutt_str_strcasecmp(rx->pattern, np->regex->pattern) == 0) 145 break; /* already on the rl */ 146 } 147 --- diff --git a/mutt/regex.c b/mutt/regex.c index 6c9c37089..249852603 100644 --- a/mutt/regex.c +++ b/mutt/regex.c @@ -139,7 +139,7 @@ int mutt_regexlist_add(struct RegexList *rl, const char *str, int flags, struct /* check to make sure the item is not already on this rl */ struct RegexListNode *np = NULL; - STAILQ_FOREACH_FROM(np, rl, entries) + STAILQ_FOREACH(np, rl, entries) { if (mutt_str_strcasecmp(rx->pattern, np->regex->pattern) == 0) break; /* already on the rl */