X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pgpkey.c;h=eeb0048c63625246c7e9acd05affa2c513c8792c;hp=38048174bc6657a845f1a457e2142bc03fc19922;hb=7f7a0be369840b290248e5b0302beb447fa1b3cd;hpb=4eaac5c4a87b84ea9ec0668b4e088ac27e2d1106 diff --git a/pgpkey.c b/pgpkey.c index 3804817..eeb0048 100644 --- a/pgpkey.c +++ b/pgpkey.c @@ -12,6 +12,10 @@ # include "config.h" #endif +#include +#include +#include + #include "mutt.h" #include "enter.h" #include "ascii.h" @@ -23,9 +27,6 @@ #include "pager.h" #include "sort.h" -#include "lib/mem.h" -#include "lib/intl.h" -#include "lib/str.h" #include "lib/debug.h" #include @@ -453,7 +454,7 @@ static pgp_key_t pgp_select_key (pgp_key_t keys, ADDRESS * p, const char *s) if (i == keymax) { keymax += 5; - mem_realloc (&KeyTable, sizeof (pgp_uid_t *) * keymax); + p_realloc(&KeyTable, keymax); } KeyTable[i++] = a; @@ -625,7 +626,7 @@ static pgp_key_t pgp_select_key (pgp_key_t keys, ADDRESS * p, const char *s) } mutt_menuDestroy (&menu); - mem_free (&KeyTable); + p_delete(&KeyTable); set_option (OPTNEEDREDRAW); @@ -661,11 +662,11 @@ pgp_key_t pgp_ask_for_key (char *tag, char *whatfor, if (l) str_replace (&l->dflt, resp); else { - l = mem_malloc (sizeof (struct pgp_cache)); + l = p_new(struct pgp_cache, 1); l->next = id_defaults; id_defaults = l; - l->what = str_dup (whatfor); - l->dflt = str_dup (resp); + l->what = m_strdup(whatfor); + l->dflt = m_strdup(resp); } } @@ -741,13 +742,13 @@ BODY *pgp_make_key_attachment (char *tempf) fclose (devnull); att = mutt_new_body (); - att->filename = str_dup (tempf); + att->filename = m_strdup(tempf); att->unlink = 1; att->use_disp = 0; att->type = TYPEAPPLICATION; - att->subtype = str_dup ("pgp-keys"); + att->subtype = m_strdup("pgp-keys"); snprintf (buff, sizeof (buff), _("PGP Key %s."), tmp); - att->description = str_dup (buff); + att->description = m_strdup(buff); mutt_update_encoding (att); stat (tempf, &sb); @@ -761,16 +762,16 @@ static LIST *pgp_add_string_to_hints (LIST * hints, const char *str) char *scratch; char *t; - if ((scratch = str_dup (str)) == NULL) + if ((scratch = m_strdup(str)) == NULL) return hints; for (t = strtok (scratch, " ,.:\"()<>\n"); t; t = strtok (NULL, " ,.:\"()<>\n")) { - if (str_len (t) > 3) + if (m_strlen(t) > 3) hints = mutt_add_list (hints, t); } - mem_free (&scratch); + p_delete(&scratch); return hints; }