]> granicus.if.org Git - mutt/commitdiff
Rework logic to avoid advancing list pointer inside the for loop.
authorMichael Elkins <me@sigpipe.org>
Wed, 16 Oct 2013 16:04:29 +0000 (16:04 +0000)
committerMichael Elkins <me@sigpipe.org>
Wed, 16 Oct 2013 16:04:29 +0000 (16:04 +0000)
closes #3531

rfc822.c

index 70839dc4153c650ad1c3cf6b9b1dce11b44eef29..884c00b17430fc7bd3c870e0793b4e29bced9775 100644 (file)
--- 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;