u->data = safe_strdup (a->mailbox);
u->next = *expn;
*expn = u;
- w = rfc822_cpy_adr (t);
+ w = rfc822_cpy_adr (t, 0);
w = mutt_expand_aliases_r (w, expn);
if (head)
last->next = w;
if (fread(buf, 1, 1, rc) != 1)
{
mutt_perror (_("Error reading alias file"));
+ safe_fclose (&rc);
return;
}
if (fseek (rc, 0, SEEK_END) < 0)
recode_buf (buf, sizeof (buf));
write_safe_address (rc, buf);
fputc ('\n', rc);
- fclose (rc);
+ safe_fclose (&rc);
mutt_message _("Alias added.");
}
else
fseek_err:
mutt_perror (_("Error seeking in alias file"));
- fclose(rc);
+ safe_fclose (&rc);
return;
}
char bestname[HUGE_STRING];
int i;
+#ifndef min
#define min(a,b) ((a<b)?a:b)
+#endif
if (s[0] != 0) /* avoid empty string as strstr argument */
{