From: Michael Elkins Date: Wed, 16 Oct 2013 16:04:29 +0000 (+0000) Subject: Rework logic to avoid advancing list pointer inside the for loop. X-Git-Tag: neomutt-20160307~137^2~7 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6df61e7747b8ac64114ec4a523ab36ba7df90002;p=neomutt Rework logic to avoid advancing list pointer inside the for loop. closes #3531 --- diff --git a/rfc822.c b/rfc822.c index 70839dc41..884c00b17 100644 --- a/rfc822.c +++ b/rfc822.c @@ -812,10 +812,9 @@ ADDRESS *rfc822_cpy_adr (ADDRESS *addr, int prune) { if (prune && addr->group && (!addr->next || !addr->next->mailbox)) { - addr = addr->next; - continue; + /* ignore this element of the list */ } - if (last) + else if (last) { last->next = rfc822_cpy_adr_real (addr); last = last->next;