X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=compose.c;h=b46050ecd35b7061747e61dd20fa8d45c852c6d7;hp=78f1ab96c7001cde57084be3ce8bba8840919906;hb=9e6ab0152703ad301042ce8810859f41fbee405a;hpb=8e037c67a88cb4680c4391134c578e3b55a80f8a diff --git a/compose.c b/compose.c index 78f1ab9..b46050e 100644 --- a/compose.c +++ b/compose.c @@ -41,7 +41,6 @@ #include "nntp.h" #endif -#include "lib/mem.h" #include "lib/intl.h" #include "lib/str.h" @@ -751,11 +750,11 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ if (!(WithCrypto & APPLICATION_PGP)) break; if (idxlen == idxmax) { - mem_realloc (&idx, sizeof (ATTACHPTR *) * (idxmax += 5)); + p_realloc(&idx, idxmax += 5); menu->data = idx; } - idx[idxlen] = (ATTACHPTR *) mem_calloc (1, sizeof (ATTACHPTR)); + idx[idxlen] = p_new(ATTACHPTR, 1); if ((idx[idxlen]->content = crypt_pgp_make_key_attachment (NULL)) != NULL) { update_idx (menu, idx, idxlen++); @@ -791,8 +790,7 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ break; if (idxlen + numfiles >= idxmax) { - mem_realloc (&idx, - sizeof (ATTACHPTR *) * (idxmax += 5 + numfiles)); + p_realloc(&idx, idxmax += 5 + numfiles); menu->data = idx; } @@ -803,7 +801,7 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ for (i = 0; i < numfiles; i++) { char *att = files[i]; - idx[idxlen] = (ATTACHPTR *) mem_calloc (1, sizeof (ATTACHPTR)); + idx[idxlen] = p_new(ATTACHPTR, 1); idx[idxlen]->unowned = 1; idx[idxlen]->content = mutt_make_file_attach (att); if (idx[idxlen]->content != NULL) @@ -919,16 +917,14 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ } if (idxlen + Context->tagged >= idxmax) { - mem_realloc (&idx, - sizeof (ATTACHPTR *) * (idxmax += - 5 + Context->tagged)); + p_realloc(&idx, idxmax += 5 + Context->tagged); menu->data = idx; } for (i = 0; i < Context->msgcount; i++) { h = Context->hdrs[i]; if (h->tagged) { - idx[idxlen] = (ATTACHPTR *) mem_calloc (1, sizeof (ATTACHPTR)); + idx[idxlen] = p_new(ATTACHPTR, 1); idx[idxlen]->content = mutt_make_message_attach (Context, h, 1); if (idx[idxlen]->content != NULL) update_idx (menu, idx, idxlen++); @@ -1193,11 +1189,11 @@ int mutt_compose_menu (HEADER * msg, /* structure for new message */ continue; } if (idxlen == idxmax) { - mem_realloc (&idx, sizeof (ATTACHPTR *) * (idxmax += 5)); + p_realloc(&idx, idxmax += 5); menu->data = idx; } - idx[idxlen] = (ATTACHPTR *) mem_calloc (1, sizeof (ATTACHPTR)); + idx[idxlen] = p_new(ATTACHPTR, 1); /* Touch the file */ if (!(fp = safe_fopen (fname, "w"))) { mutt_error (_("Can't create file %s"), fname);