for (a = tmp->addr; a; a = a->next)
for (a = tmp->addr; a && a->mailbox; a = a->next)
static int parse_alias (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err){  ALIAS *tmp = Aliases;  ALIAS *last = NULL;  char *estr = NULL;    if (!MoreArgs (s))  {    strfcpy (err->data, _("alias: no address"), err->dsize);    return (-1);  }  mutt_extract_token (buf, s, 0);  dprint (2, (debugfile, "parse_alias: First token is '%s'.\n",	      buf->data));    /* check to see if an alias with this name already exists */  for (; tmp; tmp = tmp->next)  {    if (!mutt_strcasecmp (tmp->name, buf->data))      break;    last = tmp;  }  if (!tmp)  {    /* create a new alias */    tmp = (ALIAS *) safe_calloc (1, sizeof (ALIAS));    tmp->self = tmp;    tmp->name = safe_strdup (buf->data);    /* give the main addressbook code a chance */    if (CurrentMenu == MENU_ALIAS)      set_option (OPTMENUCALLER);  }  else  {    /* override the previous value */    rfc822_free_address (&tmp->addr);    if (CurrentMenu == MENU_ALIAS)      set_option (OPTFORCEREDRAWINDEX);  }  mutt_extract_token (buf, s, M_TOKEN_QUOTE | M_TOKEN_SPACE | M_TOKEN_SEMICOLON);  dprint (2, (debugfile, "parse_alias: Second token is '%s'.\n",	      buf->data));  tmp->addr = mutt_parse_adrlist (tmp->addr, buf->data);  if (last)    last->next = tmp;  else    Aliases = tmp;  if (mutt_addrlist_to_idna (tmp->addr, &estr))  {    snprintf (err->data, err->dsize, _("Warning: Bad IDN '%s' in alias '%s'.\n"),	      estr, tmp->name);    return -1;  }#ifdef DEBUG  if (debuglevel >= 2)   {    ADDRESS *a;    for (a = tmp->addr; a; a = a->next)    {      if (!a->group)	dprint (2, (debugfile, "parse_alias:   %s\n",		    a->mailbox));      else	dprint (2, (debugfile, "parse_alias:   Group %s\n",		    a->mailbox));    }  }#endif  return 0;}