X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pgp.c;h=a19c490758a7af50d1c785e8003ed623c31e0afb;hp=5e886dbf5d0ee47eb6cd410fc4e5f7eeafa230b3;hb=28c2fbe53cf73c57fd80bf332b4f4674ee09198b;hpb=a8477ebaa09990b3688164cbe5cf661c4189541d diff --git a/pgp.c b/pgp.c index 5e886db..a19c490 100644 --- a/pgp.c +++ b/pgp.c @@ -22,10 +22,14 @@ #endif #include "mutt.h" +#include "enter.h" +#include "ascii.h" +#include "handler.h" #include "mutt_curses.h" #include "pgp.h" #include "mime.h" #include "copy.h" +#include "attach.h" #include "lib/mem.h" #include "lib/intl.h" @@ -151,7 +155,7 @@ static int pgp_copy_checksig (FILE * fpin, FILE * fpout) fputs (line, fpout); fputc ('\n', fpout); } - FREE (&line); + mem_free (&line); } else { debug_print (2, ("No pattern.\n")); @@ -361,14 +365,13 @@ void pgp_application_pgp_handler (BODY * m, STATE * s) state_attach_puts (_("[-- End of PGP output --]\n\n"), s); } } - } - /* treat empty result as sign of failure */ - if (pgpout !=NULL) - if (! ftell(pgpout)) { - mutt_error _("Could not decrypt PGP message"); - goto out; + /* treat empty result as sign of failure */ + if (!(pgpout && ftell (pgpout))) { + mutt_error _("Could not decrypt PGP message"); + goto out; } + } /* * Now, copy cleartext to the screen. NOTE - we expect that PGP @@ -1100,7 +1103,7 @@ char *pgp_findKeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc) k_info = pgp_getkeybystr (keyID, KEYFLAG_CANENCRYPT, PGP_PUBRING); } else if (r == -1) { - FREE (&keylist); + mem_free (&keylist); rfc822_free_address (&tmp); rfc822_free_address (&addr); return NULL; @@ -1117,7 +1120,7 @@ char *pgp_findKeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc) if ((key = pgp_ask_for_key (buf, q->mailbox, KEYFLAG_CANENCRYPT, PGP_PUBRING)) == NULL) { - FREE (&keylist); + mem_free (&keylist); rfc822_free_address (&tmp); rfc822_free_address (&addr); return NULL; @@ -1130,7 +1133,7 @@ char *pgp_findKeys (ADDRESS * to, ADDRESS * cc, ADDRESS * bcc) bypass_selection: keylist_size += str_len (keyID) + 4; - safe_realloc (&keylist, keylist_size); + mem_realloc (&keylist, keylist_size); sprintf (keylist + keylist_used, "%s0x%s", keylist_used ? " " : "", /* __SPRINTF_CHECKED__ */ keyID); keylist_used = str_len (keylist);