X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=pgp.c;h=779b2f4f460c120e8d0288f4ab5d2061facbf8d5;hp=53ff14baa8d13e06b20ad2315e8b8f4b04343440;hb=3db1eed8cb47ae930ec78a1dc6576f608363da85;hpb=48197ec45abcad3e3e07c18e06b2df4bc5098a3f diff --git a/pgp.c b/pgp.c index 53ff14b..779b2f4 100644 --- a/pgp.c +++ b/pgp.c @@ -369,14 +369,17 @@ int pgp_application_pgp_handler (BODY * m, STATE * s) } /* treat empty result as sign of failure */ - rewind (pgpout); - if ((c = fgetc (pgpout)) == EOF) { + if (pgpout) { + rewind (pgpout); + c = fgetc (pgpout); + ungetc (c, pgpout); + } + if (!pgpout || c == EOF) { mutt_error _("Could not decrypt PGP message"); pgp_void_passphrase (); rc = -1; goto out; } - ungetc (c, pgpout); } /*