]> granicus.if.org Git - neomutt/commitdiff
Use AddressList in mutt_addr_has_recips
authorPietro Cerutti <gahr@gahr.ch>
Mon, 13 May 2019 12:25:48 +0000 (12:25 +0000)
committerRichard Russon <rich@flatcap.org>
Thu, 23 May 2019 10:57:09 +0000 (11:57 +0100)
address/address.c

index 1bd761aa746143d8586ec94dca03b3a5d2976a96..2abd24dccb92bee8945d36fa71af52456cdfac08 100644 (file)
@@ -920,13 +920,15 @@ bool mutt_addr_cmp_strict(const struct Address *a, const struct Address *b)
 int mutt_addr_has_recips(struct Address *a)
 {
   int c = 0;
-
-  for (; a; a = a->next)
+  struct AddressList *al = mutt_addr_to_addresslist(a);
+  struct AddressNode *an = NULL;
+  TAILQ_FOREACH(an, al, entries)
   {
-    if (!a->mailbox || a->group)
+    if (!an->addr->mailbox || an->addr->group)
       continue;
     c++;
   }
+  FREE(&an);
   return c;
 }